Repository navigation
Job options, worker limits, queue commands, fake fixes - #18
Conversation
- Jobs: retryUntil, maxExceptions, failOnTimeout. dispatch(delayUntil:), dispatchIf, dispatchUnless. - Worker: --backoff, --max-jobs, --max-time, --memory. - Commands: clear, restart, prune-failed. - QueueFake: 'an UnusedJob'; keep Mail.useQueue() when Mail.fake() was on.
Bot reviewBlocking: none. Checked: old rows decode the same (new keys are left out when not set). A job without the new options takes the same path as before. A custom driver that Non-blocking:
Checks: |
Low items from todo.md for dox-queue. All changes are opt-in. Jobs and rows from the old version work as before.
Mail.fake()was on beforeQueue.fake(),Queue.restore()lost aMail.useQueue()queue. NowQueue.fake()leaves the mail queue alone whileMail.fake()is on._adoc comment now sits on_a.Mail.useQueue(null)withaddTearDown, so a failedexpectdoes not leak it.retryUntil,maxExceptionsandfailOnTimeout.retryUntilis read once at dispatch and saved in the payload. The exception count is saved in the payload too. Both keys are left out when not set, so old rows decode as before.dispatch(delayUntil: DateTime).delay: Durationstill works. Giving both throws anArgumentError.dispatchIfanddispatchUnless.dispatchAfterResponse. dox_core has no after-response hook that a job can reach. It only has route-levelTerminableMiddleware, and the job has no handle on the current request.--backoff,--max-jobs,--max-timeand--memory.bin/queue.dart:clear [queue],restartandprune-failed --hours=N.restartwrites a time to the app cache. A running worker reads that cache key every 3 seconds and stops after its current jobs when the value changes.QueueDriver.clear()andQueueDriver.pruneFailed(). The default versions throwUnsupportedError, so a custom driver that extendsQueueDriverstill compiles.Note:
QueueDriver.release()now also savesjob.payload. This keeps the exception count. A custom driver that ignores it still works, butmaxExceptionsthen never reaches its limit.Follow-up in other repos:
queue:clear,queue:restartandqueue:prune-failedentries incommand_registry.dart.dox/docs/digging-deeper/queue.mdneeds the same lines as the README.