pub struct InMemoryJobQueue { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Default for InMemoryJobQueue
impl Default for InMemoryJobQueue
Source§impl JobQueue for InMemoryJobQueue
impl JobQueue for InMemoryJobQueue
Source§async fn enqueue(&self, job: QueuedJob) -> Result<(), QueueError>
async fn enqueue(&self, job: QueuedJob) -> Result<(), QueueError>
Enqueue a job for execution. Called by the scheduler when dependencies are met.
Source§async fn claim(
&self,
worker_id: &str,
worker_labels: &[String],
lease_ttl: Duration,
) -> Result<Option<(QueuedJob, Lease)>, QueueError>
async fn claim( &self, worker_id: &str, worker_labels: &[String], lease_ttl: Duration, ) -> Result<Option<(QueuedJob, Lease)>, QueueError>
Atomically claim the next available job matching the worker’s labels.
Returns
None if no matching job is available.Source§async fn renew_lease(
&self,
lease_id: &str,
extend_by: Duration,
) -> Result<(), QueueError>
async fn renew_lease( &self, lease_id: &str, extend_by: Duration, ) -> Result<(), QueueError>
Renew a lease (heartbeat). Returns error if the lease has already expired.
Source§async fn complete(
&self,
lease_id: &str,
outputs: HashMap<String, String>,
) -> Result<(), QueueError>
async fn complete( &self, lease_id: &str, outputs: HashMap<String, String>, ) -> Result<(), QueueError>
Complete a job successfully. Releases the lease and stores outputs.
Source§async fn fail(
&self,
lease_id: &str,
error: String,
retryable: bool,
) -> Result<(), QueueError>
async fn fail( &self, lease_id: &str, error: String, retryable: bool, ) -> Result<(), QueueError>
Fail a job. The queue decides whether to re-enqueue based on RetryPolicy.
Source§async fn cancel(
&self,
workflow_id: &str,
job_id: &str,
) -> Result<(), QueueError>
async fn cancel( &self, workflow_id: &str, job_id: &str, ) -> Result<(), QueueError>
Cancel a specific job. If currently claimed, marks it for cancellation.
Source§async fn cancel_workflow(&self, workflow_id: &str) -> Result<(), QueueError>
async fn cancel_workflow(&self, workflow_id: &str) -> Result<(), QueueError>
Cancel all jobs for a workflow.
Source§async fn is_cancelled(
&self,
workflow_id: &str,
job_id: &str,
) -> Result<bool, QueueError>
async fn is_cancelled( &self, workflow_id: &str, job_id: &str, ) -> Result<bool, QueueError>
Check if a job has been marked for cancellation (workers poll this).
Source§async fn reap_expired_leases(&self) -> Result<Vec<JobEvent>, QueueError>
async fn reap_expired_leases(&self) -> Result<Vec<JobEvent>, QueueError>
Collect expired leases and emit LeaseExpired events.
Called periodically by the server’s monitor task.
Auto Trait Implementations§
impl !Freeze for InMemoryJobQueue
impl !RefUnwindSafe for InMemoryJobQueue
impl Send for InMemoryJobQueue
impl Sync for InMemoryJobQueue
impl Unpin for InMemoryJobQueue
impl UnsafeUnpin for InMemoryJobQueue
impl UnwindSafe for InMemoryJobQueue
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