Crate asynq_macros

Crate asynq_macros 

Source
Expand description

§Asynq Macros

Procedural macros for asynq task handler registration.

This crate provides attribute macros similar to actix-web’s routing macros, allowing you to register task handlers with a simple attribute syntax.

§Examples

use asynq_macros::task_handler;
use asynq::{task::Task, error::Result};

#[task_handler("email:send")]
fn handle_email(task: Task) -> Result<()> {
    println!("Handling email task");
    Ok(())
}

Macros§

register_async_handlers
Macro for automatically registering asynchronous handlers with ServeMux
register_handlers
Macro for automatically registering synchronous handlers with ServeMux

Attribute Macros§

task_handler
Attribute macro for registering synchronous task handlers
task_handler_async
Attribute macro for registering asynchronous task handlers