What's Changed
- feat: add fail-over tasks and indexed task enumeration by @Graeme22 in #166
-
Task.otherwise()for fallback execution when a task fails:await my_task.enqueue(4).then(other_task).otherwise(backup_task)
Here, if
other_taskfails,backup_taskwill run with the same arguments. Read more here. -
Replace SCAN-based
_get_running_tasks/_get_completed_taskswith a set for running tasks and an expiry-scored sorted set for finished tasks. Fixes #163 where scan over keyspace is too expensive in deployments with millions of keys -
New context API:
Worker.context,RegisteredTask.context,RegisteredMiddleware.context. DeprecateWorkerDependsandTaskDepends(slated for removal in v7.0.0). Code that looked like:@worker.task async def my_task(task_context: TaskContext = TaskDepends(), worker_context: WorkerContext = WorkerDepends()) -> None: ...
Becomes:
@worker.task async def my_task() -> None: reveal_type(worker.context) # WorkerContext reveal_type(my_task.context) # TaskContext
-
- Reuse lua lib instance in enqueue_many by @alisaifee in #159
- Add documentation for OpenTelemetry integration by @definite-d in #165
New Contributors
- @alisaifee made their first contribution in #159
- @definite-d made their first contribution in #165
Full Changelog: v6.4.0...v6.5.0