Extracted feature request from #41
- a new status
cancelled
- a new field
cancelledAt
- a new method
cancelJob on queue level, which can be called to trigger the cancellation ( and sets the status + cancelledAt )
- a new event
job:cancelled
- a new event
job:cancel:{jobId}
To process the cancellation, we're extending the processJob and processBatchJobs and listen to the job:cancel:${jobId} event and stop the processing ( inside processJob we just have to extend the Promise.race.
For processBatchJobs, we have to modify the current implementation ( maybe, we just have to call processJob from processBatchJobs 🤔 ).
it's similar to the current timeout implementation.
Note: We should also check if an AbortController ( as @maelp mention here: #41 (comment) ) could work.
Extracted feature request from #41
cancelledcancelledAtcancelJobon queue level, which can be called to trigger the cancellation ( and sets the status +cancelledAt)job:cancelledjob:cancel:{jobId}To process the cancellation, we're extending the
processJobandprocessBatchJobsand listen to thejob:cancel:${jobId}event and stop the processing ( insideprocessJobwe just have to extend thePromise.race.For
processBatchJobs, we have to modify the current implementation ( maybe, we just have to callprocessJobfromprocessBatchJobs🤔 ).it's similar to the current
timeoutimplementation.Note: We should also check if an AbortController ( as @maelp mention here: #41 (comment) ) could work.