Phase 5 of the roadmap to v1.0.0 adds three management features: update_task(), rich job/task queries, and stats(). See the new Observability docs page.
What's new
update_task()— changes a scheduled task in place and keeps itstask_id. You can change the name, interval, scheduling mode, args/kwargs, timeout, retry settings, jitter, and the progress callback. All parameters are keyword-only; omit the parameters you do not want to change.timeout=Nonedisables the timeout, andprogress_callback=Noneremoves the callback. When you changeinterval, quiv reschedules the next run tonow + interval. When you update arunningtask, the changes apply from its next run. The method emits the newEvent.TASK_UPDATEDwith the updatedTask. You cannot changerun_once,delay, or the handlerfunc.- Rich job/task queries —
get_all_jobs()accepts new filters:task_id, andsince/untilfor a time window onstarted_at(pass timezone-aware UTC values). It also acceptsorder_by("started_at"or"ended_at"),descending, andlimit/offsetfor pagination.get_all_tasks()acceptsstatus,limit, andoffset, and returns tasks ordered bynext_run_at. stats()— returns aQuivStatssnapshot (a frozen dataclass, exported fromquiv). It contains the active job count, the pool size and utilization, task counts by status, the earliest upcoming run, and the retained job-history count.- The FastAPI example app has three new endpoints:
GET /tasks/stats,GET /tasks/{task_id}/jobs?limit=&offset=, andPATCH /tasks/{task_id}.
Fixes
add_task()no longer requires anintervalfor a run-once task (#65). A run-once task never repeats, so quiv never reads its interval. Omitintervalwhen you passrun_once=True. An interval given withrun_once=Trueis ignored, andTask.interval_secondsreadsNone. A recurring task still requiresinterval > 0.interval=Nonenow raisesConfigurationError(#65). Earlier versions raisedTypeErrorfrom an unguarded comparison.Nonenow reaches the same error as0and-1.run_task_immediately()raisesTaskNotFoundErrorfor an unknown task id (#67). Earlier versions raisedHandlerNotRegisteredError, which names a different fault.get_task(),remove_task()andrun_task_immediately()now report the same error for the same cause. A run-once task deletes itself when it finishes, so its id stops resolving after it runs.HandlerNotRegisteredErrorkeeps its own meaning: the task exists, but no handler is registered for it.
Behavior changes
TaskNotScheduledErroris deprecated. quiv no longer raises it. It is now a subclass ofTaskNotFoundError, and the name stays exported, so imports keep working. Anexcept TaskNotScheduledErrorclause no longer catches these errors. Change it toexcept TaskNotFoundError. quiv removes the alias in 1.0.0.
Full Changelog: v0.8.0...v0.9.0