Struct background_jobs_core::Storage
source · pub struct Storage { /* private fields */ }
Expand description
All the logic to interact with the persisted data is defined on this type.
Perhapse in the future this will be made generic, but for now it is hard-coded to use LMDB to store job information.
None of the methods in this module are intended to be used outside of a background-jobs runtime.
Implementations
sourceimpl Storage
impl Storage
pub fn new(store: Arc<RwLock<Store>>) -> Self
pub fn init(path: PathBuf) -> Result<Self, Error>
pub fn get_new_id(&self, runner_id: usize) -> Result<usize, Error>
pub fn requeue_staged_jobs(&self, runner_id: usize) -> Result<(), Error>
pub fn check_stalled_jobs(&self, runner_id: usize) -> Result<(), Error>
pub fn stage_jobs(
&self,
limit: usize,
queue: &str,
runner_id: usize
) -> Result<Vec<JobInfo>, Error>
pub fn assign_id(
&self,
job: NewJobInfo,
runner_id: usize
) -> Result<JobInfo, Error>
pub fn store_job(&self, job: JobInfo, runner_id: usize) -> Result<(), Error>
pub fn get_port_mapping(
&self,
base_port: usize,
queues: BTreeSet<String>,
runner_id: usize
) -> Result<BTreeMap<String, usize>, PortMapError>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more