Skip to main content

Crate sova_tasks

Crate sova_tasks 

Source
Expand description

Background task worker + optional scheduler + HTTP dispatch for Sova.

Modules§

priority
Common priority levels (higher is claimed first).

Structs§

ConsoleGuard
RAII guard: enables is_interactive until dropped.
Dispatch
One-shot (or delayed) enqueue request.
HttpTaskError
HTTP-facing wrapper around TaskError that maps into Error::Response.
Job
Named handler with optional recurring schedule, queue, and priority.
JobInfo
One registered job (for CLI tasks list / tasks schedule).
TaskBackend
App state handle for dispatch from request handlers.
TaskDispatched
Fired after a task is successfully enqueued.
TaskFailed
Fired when a worker marks a task as terminal failure (no more retries).
TaskRegistry
App-state registry for CLI and introspection.
Tasks
Registers jobs and runs a worker (and optional scheduler) as [BackgroundService]s.

Enums§

Schedule
When a Job should be enqueued by the scheduler.

Functions§

ask
Prompt for a line of input. Errors when not interactive.
bearer_guard
Require Authorization: Bearer <token> for task HTTP routes.
confirm
Yes/no prompt. When not interactive, returns default.
enter_cli
Enable interactive console for the current thread (CLI tasks run).
error
Print an error when interactive.
every_slot
Slot id for an every-schedule at now (exported for tests).
info
Print an info line when interactive; otherwise no-op.
is_interactive
True while inside enter_cli.
line
Print a blank or custom line when interactive.
parse_cron
Pad 5-field crontab to 6-field (seconds = 0) for the cron crate.
table
Print a simple ASCII table when interactive.
warn
Print a warning when interactive.