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

thenAcceptAsync (Future method)

Last update:
May 18, 2026
After this Future succeeds, runs a side-effect action on the async executor. The action receives the result and returns nothing useful to the chain.

Description

Use thenAcceptAsync for logging, assigning to outer variables, or other work that consumes the result without returning a new mapped value. The next stage still receives the same completion as thenApplyAsync would propagate; chaining continues with a Future that completes after the action runs.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.thenAcceptAsync(action)

Parameters

ParameterDescription
actionRequired. A function that takes the previous result and performs an action (void return).

See also

thenAccept

Example

Consume a string result into a variable (from product tests).

<cfscript>
    future = runAsync(function() 
    { return "test"; });
    consumed = future.thenAcceptAsync(function(x) {    
        variables.consumed = x;});consumed.get();
    writeOutput(variables.consumed); // test
</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