Whatever message this page gives is out now! Go check it out!
future.acceptEitherAsync(other, action)| Parameter | Description |
|---|---|
| other | Required. The other Future to race. |
| action | Required. A function that takes the first completed value and performs an action (void return). |
<cfscript>
f1 = runAsync(function() { return "winner"; });
f2 = runAsync(function() { sleep(1000); return "loser";});
either = f1.acceptEitherAsync(f2, function(x) { variables.winner = x;});
either.get();
writeOutput(variables.winner); // winner
</cfscript>