Whatever message this page gives is out now! Go check it out!

thenAcceptBothAsync (Future method)

Last update:
May 18, 2026
When this Future and another Future both succeed, runs an action with both values on the async executor.

Description

thenAcceptBothAsync is the consuming counterpart to thenCombineAsync. Use it when you need both results for side effects instead of returning a combined value from the callback.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.thenAcceptBothAsync(other, action)

Parameters

ParameterDescription
otherRequired. The other Future to wait for.
actionRequired. A function (resultA, resultB) that performs an action (void return).

See also

thenAcceptBoth

Example

Concatenate two string results (from product tests).

 <cfscript>
    f1 = runAsync(function() { return "A"; });
    f2 = runAsync(function() { return "B"; });
    variables.result = "";
    consumed = f1.thenAcceptBothAsync(f2, function(x, y) {    variables.result = x & y;});
    consumed.get();
    writeOutput(variables.result); // AB
</cfscript>
      

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page