Trait mas_storage::job::JobRepository
source · pub trait JobRepository: Send + Sync {
type Error;
// Required method
fn schedule_submission<'life0, 'async_trait>(
&'life0 mut self,
submission: JobSubmission,
) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A JobRepository
is used to schedule jobs to be executed by a worker.
Required Associated Types§
Required Methods§
sourcefn schedule_submission<'life0, 'async_trait>(
&'life0 mut self,
submission: JobSubmission,
) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn schedule_submission<'life0, 'async_trait>(
&'life0 mut self,
submission: JobSubmission,
) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Schedule a job submission to be executed at a later time.
§Parameters
submission
- The job to schedule.
§Errors
Returns Self::Error
if the underlying repository fails