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