ThreadPool Request

Hi Jules

Can you consider adding this callback to your todo queue:
ThreadPool::JobFinished(ThreadPoolJob *job)

Or a more general one:
ThreadPool::JobStatusChanged(ThreadPoolJob *job)

I’m currently using a workaround with the ThreadPool::waitForJobToFinish()

Thanks

I can’t add that - the ThreadPool isn’t designed to have any virtual methods.

And you already have a place to put code that should be run when a job finishes: put it at the end of the job itself!

Yes but there’s all the abnormal cases like shouldExit() and such, and adding it to the jobs will mean another inheritance to the ThreadPoolJob.
I just thought it will be more smoothly that way.

It’s trivial to just add whatever call you need at the end of your runJob() method, and that’d certainly be much cleaner than changing the ThreadPool class to be inheritable and then creating subclasses of it, just to find out when a job has finished!

Got it.
Thanks Jules