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

thenRunAsync (Future method)

Last update:
May 18, 2026
After this Future succeeds, runs an action with no arguments on the async executor.

Description

thenRunAsync is for work that does not need the prior result value. It still waits for the previous stage to succeed before it runs.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.thenRunAsync(action)

Parameters

ParameterDescription
actionRequired. A function with no parameters that performs an action (void return).

See also

Example

Set a flag after the prior stage completes (from product tests).

 <cfscript>
    future = runAsync(function() { 
        return "done"; });
    executed = future.thenRunAsync(function() {    
    variables.executed = true;});executed.get();
    writeOutput(variables.executed ? "EXECUTED" : "NOT_EXECUTED"); // EXECUTED
</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