Wondering if anyone has a good way to track coldbo...
# fusion-reactor
d
Wondering if anyone has a good way to track coldbox async manager threads in fusion reactor? I’ve had a look at the frapi docs but can’t quite work out how to implement
b
You'll be able to see them in the threads view of FR
Buy the threads in the executor pool will just appear as long running threads
You can hse my frapi lib on forgebox to define transaction start/stops so each task run shows as a proper transaction in FR
d
Thanks Brad. I’ll take a look.
b
d
I think I can use that. What I want is for the main fr transaction to say “I’m starting a thread” and then inside the thread to be able to track work being done, eg http calls
I guess a bit like what happens if you use cfthread, you can see the threads being started in the main transaction
For anyone playing along at home, this seems to work for my use case. It adds the sub-transaction to the master in a similar way that you would see with cfthread
Copy code
<cfscript>
    async = new Library.coldbox.system.async.AsyncManager();
    arr = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
    mastertran = application.FRTransService.getFRAPI().getActiveTransaction()
    results = async.allApply(arr, function(item) {
        var subtran = application.FRTransService.startTransaction( item, item, {"im-a-prop": "im-a-value"} );
        mastertran._addChildTransaction(subtran)
        sleep(1000)
        application.FRTransService.endTransaction( subtran )
        return (item);
    });
    writeDump(results);
</cfscript>
b
Yep, pretty cool feature
I use it in CommandBox and in the BoxLang miniserver