pub trait QueueJobRepositoryExt: QueueJobRepository {
// Required methods
fn schedule_job<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn schedule_job_later<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
scheduled_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Extension trait for QueueJobRepository
to help adding a job to the queue
through the InsertableJob
trait. This isn’t in the
QueueJobRepository
trait to keep it object safe.
Required Methods§
sourcefn schedule_job<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn schedule_job<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
sourcefn schedule_job_later<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
scheduled_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn schedule_job_later<'life0, 'life1, 'life2, 'async_trait, J>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
job: J,
scheduled_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
J: 'async_trait + InsertableJob,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Schedule a job to be executed at a later date by a worker.
§Parameters
rng
- The random number generator used to generate a new job IDclock
- The clock used to generate timestampsjob
- The job to schedulescheduled_at
- The date and time to schedule the job for
§Errors
Returns an error if the underlying repository fails.
Object Safety§
This trait is not object safe.