pub trait JobDispatch: Send + Sync {
// Required methods
fn get_info(&self, job_type: &str) -> Option<JobInfo>;
fn dispatch_by_name(
&self,
job_type: &str,
args: Value,
owner_subject: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + '_>>;
fn cancel(
&self,
job_id: Uuid,
reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + '_>>;
}Expand description
Trait for dispatching jobs from function contexts.
This trait allows mutation and action contexts to dispatch background jobs without directly depending on the runtime’s JobDispatcher.