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

thenAcceptBoth (Future method)

Last update:
Jun 9, 2026
When both futures succeed, runs your action on the completing thread with both values.

Description

Synchronous counterpart to thenAcceptBothAsync.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.thenAcceptBoth(other, action)

Parameters

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

See also

Example

Concatenate two strings (from product tests).

<cfscript>
    f1 = runAsync(function() { return "A"; });
    f2 = runAsync(function() { return "B"; });
    consumed = f1.thenAcceptBoth(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