Attribute Macro coil_proc_macro::background_job [−][src]
#[background_job]
Expand description
The attribute macro for creating background jobs.
Examples
ⓘ
// I cant be asynchronous because I'll block the executor #[background_job] fn perform_heavy_computation(foo: HeavyComputation) -> Result<(), PerformError> { foo.compute()?; Ok(()) }
ⓘ
#[background_job] async fn crawl_for_new_info(website: Website) -> Result<(), PerformError> { let content = website.get_content().await?; content.modify().send_to_actor_pipeline(); }