Struct background_jobs_core::memory_storage::Storage
source · pub struct Storage<T> { /* private fields */ }
Expand description
An In-Memory store for jobs
Implementations§
Trait Implementations§
source§impl<T: Timer + Send + Sync + Clone> Storage for Storage<T>
impl<T: Timer + Send + Sync + Clone> Storage for Storage<T>
source§fn push<'life0, 'async_trait>(
&'life0 self,
job: NewJobInfo
) -> Pin<Box<dyn Future<Output = Result<Uuid, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn push<'life0, 'async_trait>(
&'life0 self,
job: NewJobInfo
) -> Pin<Box<dyn Future<Output = Result<Uuid, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
push a job into the queue
source§fn pop<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
runner_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<JobInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pop<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
runner_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<JobInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
pop a job from the provided queue
source§fn heartbeat<'life0, 'async_trait>(
&'life0 self,
job_id: Uuid,
runner_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn heartbeat<'life0, 'async_trait>(
&'life0 self,
job_id: Uuid,
runner_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
mark a job as being actively worked on
source§fn complete<'life0, 'async_trait>(
&'life0 self,
__arg1: ReturnJobInfo
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete<'life0, 'async_trait>(
&'life0 self,
__arg1: ReturnJobInfo
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
“Return” a job to the database, marking it for retry if needed
§type Error = Infallible
type Error = Infallible
The error type used by the storage mechansim.
Auto Trait Implementations§
impl<T> Freeze for Storage<T>where
T: Freeze,
impl<T> RefUnwindSafe for Storage<T>where
T: RefUnwindSafe,
impl<T> Send for Storage<T>where
T: Send,
impl<T> Sync for Storage<T>where
T: Sync,
impl<T> Unpin for Storage<T>where
T: Unpin,
impl<T> UnwindSafe for Storage<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more