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