pub struct AppQueue { /* private fields */ }
Implementations§
Source§impl AppQueue
Central queue interface
impl AppQueue
Central queue interface
See the crate documentation to see how to use this crate.
Sourcepub async fn new(db_path: impl AsRef<Path>) -> Result<Arc<Self>>
pub async fn new(db_path: impl AsRef<Path>) -> Result<Arc<Self>>
Opens or creates a new queue.
§Errors
This function returns an error if the database cannot be opened, such as when the database is inaccessible or corrupt.
Sourcepub async fn run_job_loop(self: Arc<Self>) -> Result<Never>
pub async fn run_job_loop(self: Arc<Self>) -> Result<Never>
Uses the current task to serve as a job runner.
This future will never resolve, unless an error occurs.
Sourcepub fn run_job_workers(self: Arc<Self>, num_workers: usize)
pub fn run_job_workers(self: Arc<Self>, num_workers: usize)
Spawns a number of worker tasks for running jobs.
Sourcepub fn run_job_workers_default(self: Arc<Self>)
pub fn run_job_workers_default(self: Arc<Self>)
Spawns a default number of worker tasks for running jobs.
Auto Trait Implementations§
impl !Freeze for AppQueue
impl !RefUnwindSafe for AppQueue
impl Send for AppQueue
impl Sync for AppQueue
impl Unpin for AppQueue
impl !UnwindSafe for AppQueue
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more