CFEXECUTE add onProgress, onError listeners to stream output and allow cancelling execution

Description

it would be nice to be able to stream output from cfexecute, i.e. flushing rather than waiting for the process to complete before sending content to the browser

I particularly would like this for running CI tests

When the onProgress listener is defined, all output goes only to the listener, the outputfile, errorFile, variable, and errorVariable will be empty / null

The listener can do what ever it likes, appending to a file, streaming to the browser with flush, storing the output in a variable etc

The listener will be called for each line output to the console by the process

Check out the testcases for examples: https://github.com/lucee/Lucee/blob/7.0/test/tickets/LDEV3667.cfc

Activity

Pothys - MitrahSoft 
22 April 2025 at 14:41

I have tested this ticket with Lucee version 7.0.0.203-SNAPSHOT. When I tried to run the cfexecute with the onProgress and onError attributes, both listeners canceled execution by using return false. The error message is also available in onProgress if onError is not used, and it works fine as expected.

Zac Spitzer 
14 April 2025 at 16:20

Zac Spitzer 
14 April 2025 at 15:52

I’ve added the ability to cancel a process execution by returning false from a listener UDF

if onProgress is defined, but not onError, I also redirect the error output to to the onProgress listener

Zac Spitzer 
14 April 2025 at 12:12
(edited)

needed an executorService.awaitTermination(timeout, TimeUnit.SECONDS); aka join()

noice

Zac Spitzer 
14 April 2025 at 10:59
(edited)

First take, I’ve added onError and onProgress listeners

Fixed

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Fix versions

Priority

Created 12 August 2021 at 09:26
Updated 22 April 2025 at 14:41
Resolved 22 April 2025 at 14:41