This changes the behavior of the Worker's pendingJobCount and takePendingJob which now will not include terminated jobs, but will only have valid jobs and terminate worker jobs.
The new approach to determine if the job you are running should be cancelled while you are processing it is to use Worker:: jobShouldBeTerminated .
Also the easiest way to determine if the worker was requested to shutdown is to use Worker::workerShouldTerminate. This way you don't have to pull a job off the queue to see if it is a terminate worker job.
@vibraphone @judajake
This changes the behavior of the Worker's
pendingJobCount
andtakePendingJob
which now will not include terminated jobs, but will only have valid jobs and terminate worker jobs.The new approach to determine if the job you are running should be cancelled while you are processing it is to use
Worker:: jobShouldBeTerminated
.Also the easiest way to determine if the worker was requested to shutdown is to use
Worker::workerShouldTerminate
. This way you don't have to pull a job off the queue to see if it is a terminate worker job.