Whatever message this page gives is out now! Go check it out!
future.applyToEither(other, function)| Parameter | Description |
|---|---|
| other | Required. The other Future to race. |
| function | Required. A function that accepts the first completed value and returns the transformed value. |
<cfscript>
f1 = runAsync(function() { return "fast"; });
f2 = runAsync(function() {
sleep(1000);
return "slow";
});
either = f1.applyToEither(f2, function(x) {
return x & "_processed";
});
writeOutput(either.get()); // fast_processed
</cfscript>