Whatever message this page gives is out now! Go check it out!
future.whenComplete(action)| Parameter | Description |
|---|---|
| action | Required. A function (value, error) that observes completion. One of the two arguments is null depending on success or failure. |
<cfscript>
future = runAsync(function() { return 10; })
.thenApplyAsync(function(x) { return x * 2; })
.whenComplete(function(value, error) {
variables.completed = true;
variables.finalValue = value;
});
future.get();
writeOutput(variables.completed & ":" & variables.finalValue); // true:20
</cfscript>