Skip to main content

JobHandler

Type Alias JobHandler 

Source
pub type JobHandler = fn(payload: Value, container: Container) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>>;
Expand description

Type-erased async job handler the #[processor] macro emits for each #[process] method. Backends invoke it with a JSON payload pulled off their wire; the closure deserializes to the user’s job type, resolves the provider from the container, and dispatches.