pub struct WorkQueue<M>{ /* private fields */ }Implementations§
Source§impl<M> WorkQueue<M>
impl<M> WorkQueue<M>
pub fn new(job_name: String, backend: Arc<dyn Backend>) -> WorkQueue<M>
Sourcepub fn queue_name(&self) -> &str
pub fn queue_name(&self) -> &str
Get the queue name (used as prefix for all queue keys)
pub fn start_with_name( name: String, backend: Arc<dyn Backend + Send + Sync>, ) -> ActorRef<WorkQueue<M>>
pub fn run_with_config( &self, job: Job<M>, config: EnqueueConfig, ) -> Result<(), Error>
pub fn enqueue(&self, job: Job<M>) -> Result<(), Error>
pub fn re_enqueue(&self, job: Job<M>) -> Result<(), Error>
pub fn mark_job_is_canceled(&self, job_id: &str)
pub fn mark_job_is_finished(&self, job: Job<M>) -> Result<(), Error>
pub fn mark_job_is_failed(&self, job: Job<M>) -> Result<(), Error>
pub fn process_jobs(&self)
pub fn pick_jobs_to_process(&self) -> Result<Vec<Job<M>>, Error>
pub fn execute_job_task(&self, job: Job<M>)
pub async fn execute_job(&self, job: Job<M>) -> Result<(), Error>
pub fn cancel_job(&self, job_id: &str) -> Result<(), Error>
pub fn get_job(&self, job_id: &str) -> Result<Option<Job<M>>, Error>
pub fn retry_job(&self, job_id: &str) -> Result<bool, Error>
pub fn read_job(&self, job_id: &str) -> Result<Option<Job<M>>, Error>
pub fn get_processing_job_ids( &self, _count: usize, ) -> Result<Vec<String>, Error>
Trait Implementations§
Source§impl<M> Actor for WorkQueue<M>
impl<M> Actor for WorkQueue<M>
Source§fn name() -> &'static str
fn name() -> &'static str
The name of the actor, which can be useful for logging or debugging. Read more
Source§fn new_mailbox() -> (<WorkQueue<M> as Actor>::Mailbox, <<WorkQueue<M> as Actor>::Mailbox as Mailbox<WorkQueue<M>>>::Receiver)
fn new_mailbox() -> (<WorkQueue<M> as Actor>::Mailbox, <<WorkQueue<M> as Actor>::Mailbox as Mailbox<WorkQueue<M>>>::Receiver)
Creates a new mailbox for the actor. This sets up the message queue and receiver for the actor. Read more
Source§fn on_start(
&mut self,
actor_ref: ActorRef<Self>,
) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send
fn on_start( &mut self, actor_ref: ActorRef<Self>, ) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send
Called when the actor starts, before it processes any messages. Read more
Source§fn on_panic(
&mut self,
actor_ref: WeakActorRef<Self>,
err: PanicError,
) -> impl Future<Output = Result<Option<ActorStopReason>, Box<dyn Error + Send + Sync>>> + Send
fn on_panic( &mut self, actor_ref: WeakActorRef<Self>, err: PanicError, ) -> impl Future<Output = Result<Option<ActorStopReason>, Box<dyn Error + Send + Sync>>> + Send
Called when the actor encounters a panic or an error during “tell” message handling. Read more
Source§fn on_link_died(
&mut self,
actor_ref: WeakActorRef<Self>,
id: ActorID,
reason: ActorStopReason,
) -> impl Future<Output = Result<Option<ActorStopReason>, Box<dyn Error + Send + Sync>>> + Send
fn on_link_died( &mut self, actor_ref: WeakActorRef<Self>, id: ActorID, reason: ActorStopReason, ) -> impl Future<Output = Result<Option<ActorStopReason>, Box<dyn Error + Send + Sync>>> + Send
Called when a linked actor dies. Read more
Source§impl<M> Message<ProcessTick> for WorkQueue<M>
impl<M> Message<ProcessTick> for WorkQueue<M>
Source§impl<M> Message<UpdateWorkQueue> for WorkQueue<M>
impl<M> Message<UpdateWorkQueue> for WorkQueue<M>
Auto Trait Implementations§
impl<M> Freeze for WorkQueue<M>
impl<M> !RefUnwindSafe for WorkQueue<M>
impl<M> Send for WorkQueue<M>
impl<M> Sync for WorkQueue<M>
impl<M> Unpin for WorkQueue<M>where
M: Unpin,
impl<M> !UnwindSafe for WorkQueue<M>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn(
self: Box<T>,
state: &mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Debug + Send>>> + Send + '_>>
fn handle_dyn( self: Box<T>, state: &mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Debug + Send>>> + Send + '_>>
Handles the dyn message with the provided actor state, ref, and reply sender.
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