Skip to main content

Module worker

Module worker 

Source
Expand description

Bounded asynchronous worker for loop analysis, event emission, and capture.

Structs§

AtifCapture
Structured ATIF representation attached to an asynchronous event job.
ResponseAttempt
Durable request/terminal marker embedded in the active event journal.
ResponsePermit
Reservation for the downstream response-capture worker job. Draws from a distinct capacity semaphore so operators can tell via av_events_dropped_total{stage="response_slot"} vs stage="worker_queue" which class of admission is the bottleneck.
WorkerAndResponsePermit
Fused reservation covering a worker job AND its downstream response slot. Acquired atomically at request admission: on any failure the worker slot (if already held) is released via RAII before the error surfaces, so callers cannot end up with an orphaned half-permit.
WorkerHandle
Cloneable handle used by request handlers to submit worker jobs.
WorkerJob
Work copied from the hot path for asynchronous processing.
WorkerPermit
Guaranteed slot in the bounded worker queue.

Enums§

SubmitError
Non-blocking submission error.

Functions§

spawn_worker
Start the session-sharded worker pool (16 shards, each behind a bounded channel). Ordering is per session via hash sharding.
spawn_worker_with_sink
Start the worker pool with an explicit off-path vector sink.
spawn_worker_with_spool
Start the worker pool with vector persistence and optional ATIF journal.
spawn_worker_with_spool_authenticated
Start the worker pool with authenticated active-workflow journals.