Skip to main content

send

Attribute Macro send 

Source
#[send]
Expand description

The #[celerix::send] attribute macro.

Wraps an async function so its Future is Send, which is required by axum handlers. WASM futures (like Queue.dispatch()) are !Send.

§Example

#[celerix::send]
async fn my_handler(queue: Extension<Queue>) -> Result<String> {
    queue.dispatch(MyJob { ... }).await?;
    Ok("done".into())
}