Skip to content

Job: implement onFinish()

Dāvis Mosāns requested to merge davism/threadweaver:finish into master

It's useful to do some processing after job have finished.

Currently you can use custom Executor to accomplish this but that's not as simple and easy as:

auto job = ThreadWeaver::make_job([]() {
    // Job Lambda
});

job->onFinish([](const ThreadWeaver::JobInterface &job) {
    // Finish handler Lambda
});

ThreadWeaver::enqueue(job);

This is most useful for Collection/Sequence because for those you want handler once all jobs have finished not after each of them.

Merge request reports