Skip to main content

InMemoryJobQueue

Struct InMemoryJobQueue 

Source
pub struct InMemoryJobQueue { /* private fields */ }
Expand description

In-memory implementation of the generic job queue backend.

This backend is process-local. It is intentionally useful for development, tests, embedded runtimes, and as a reference implementation for Redis, Postgres, or NATS-backed implementations.

Implementations§

Source§

impl InMemoryJobQueue

Source

pub fn new(queue: impl Into<String>) -> Self

Create an empty queue.

Source

pub fn from_snapshot(snapshot: JobQueueSnapshot) -> Self

Restore an in-memory queue from a durable snapshot.

Source

pub fn queue_name(&self) -> &str

Queue name.

Source

pub async fn snapshot(&self) -> JobQueueSnapshot

Capture the current queue state for durable storage.

Source

pub async fn add( &self, name: impl Into<String>, payload: Value, options: JobOptions, ) -> Result<Job>

Add a job using the current wall-clock time.

Source

pub async fn add_at( &self, name: impl Into<String>, payload: Value, options: JobOptions, now: DateTime<Utc>, ) -> Result<Job>

Add a job at an explicit timestamp. Primarily useful for deterministic tests.

Source

pub async fn add_many(&self, jobs: Vec<JobSpec>) -> Result<Vec<Job>>

Add multiple jobs using the current wall-clock time.

Source

pub async fn add_many_at( &self, jobs: Vec<JobSpec>, now: DateTime<Utc>, ) -> Result<Vec<Job>>

Add multiple jobs at an explicit timestamp.

Source

pub async fn add_flow( &self, parent: JobSpec, children: Vec<JobSpec>, ) -> Result<JobFlow>

Add a parent-child flow. The parent remains blocked until every child is completed, removed, or released by a terminal failure policy.

Source

pub async fn add_flow_at( &self, parent: JobSpec, children: Vec<JobSpec>, now: DateTime<Utc>, ) -> Result<JobFlow>

Add a parent-child flow at an explicit timestamp.

Source

pub async fn add_flow_children( &self, parent_id: &str, lock_token: &str, children: Vec<JobSpec>, ) -> Result<Vec<Job>>

Add children to an active flow parent using the current wall-clock time.

Source

pub async fn add_flow_children_at( &self, parent_id: &str, lock_token: &str, children: Vec<JobSpec>, now: DateTime<Utc>, ) -> Result<Vec<Job>>

Add children to an active flow parent and move the parent to waiting-children.

Source

pub async fn get_flow_dependencies( &self, parent_id: &str, ) -> Result<Option<JobFlowDependencies>>

Return a parent flow’s current child dependency snapshot.

Source

pub async fn get_flow_dependency_counts( &self, parent_id: &str, ) -> Result<Option<JobFlowDependencyCounts>>

Return dependency counts for a flow parent.

Source

pub async fn get_flow_dependency_selected_counts( &self, parent_id: &str, options: JobFlowDependencyCountOptions, ) -> Result<Option<JobFlowDependencySelectedCounts>>

Return selected BullMQ-style dependency counts for a flow parent.

Source

pub async fn get_flow_dependency_values( &self, parent_id: &str, ) -> Result<Option<JobFlowDependencyValues>>

Return BullMQ-style full dependency buckets for a flow parent.

Source

pub async fn get_flow_dependency_page( &self, parent_id: &str, options: JobFlowDependencyPageOptions, ) -> Result<Option<JobFlowDependencyPage>>

Return one cursor page from a parent flow dependency bucket.

Source

pub async fn get_flow_dependency_pages( &self, parent_id: &str, options: JobFlowDependencyPagesOptions, ) -> Result<Option<JobFlowDependencyPages>>

Return cursor pages from several parent flow dependency buckets.

Source

pub async fn get_flow_children_values( &self, parent_id: &str, ) -> Result<Option<JobFlowChildValues>>

Return completed child result values for a flow parent.

Source

pub async fn get_flow_ignored_children_failures( &self, parent_id: &str, ) -> Result<Option<JobFlowIgnoredFailures>>

Return ignored child failure reasons for a flow parent.

Source

pub async fn remove_unprocessed_children( &self, parent_id: &str, now: DateTime<Utc>, ) -> Result<Option<Vec<Job>>>

Remove children that are still unprocessed and not active.

Source

pub async fn remove_child_dependency( &self, child_id: &str, now: DateTime<Utc>, ) -> Result<bool>

Remove a single child from its parent dependency list without deleting the child job.

Source

pub async fn get_state(&self, job_id: &str) -> Result<Option<JobState>>

Return the current state for a job id.

Source

pub async fn get_finished_result( &self, job_id: &str, ) -> Result<Option<JobFinishedResult>>

Return finished status and retained terminal payload for a job.

Source

pub async fn remove(&self, job_id: &str) -> Result<Option<Job>>

Remove a job from the queue.

Source

pub async fn remove_deduplication_key( &self, deduplication_id: &str, ) -> Result<bool>

Remove the active deduplication owner key, allowing a new owner to be added.

Source

pub async fn get_deduplication_job_id( &self, deduplication_id: &str, ) -> Result<Option<JobId>>

Return the current active job id for a deduplication id.

Source

pub async fn list_repeats(&self) -> Result<Vec<JobRepeatEntry>>

List current non-terminal repeat series owners.

Source

pub async fn get_repeat( &self, repeat_key: &str, ) -> Result<Option<JobRepeatEntry>>

Return one repeat series / job scheduler by key.

Source

pub async fn count_repeats(&self) -> Result<usize>

Return the number of current repeat series / job schedulers.

Source

pub async fn list_repeats_page( &self, options: JobRepeatListOptions, ) -> Result<JobRepeatPage>

Return repeat series / job schedulers ordered by next scheduled time.

Source

pub async fn upsert_repeat( &self, spec: JobSpec, now: DateTime<Utc>, ) -> Result<Job>

Create or replace the current non-active occurrence for a repeat series.

Source

pub async fn remove_repeat(&self, repeat_key: &str) -> Result<Option<Job>>

Remove the current non-terminal occurrence for a repeat series.

Source

pub async fn promote(&self, job_id: &str, now: DateTime<Utc>) -> Result<Job>

Promote a single delayed job to waiting.

Source

pub async fn reschedule( &self, job_id: &str, delay: Duration, now: DateTime<Utc>, ) -> Result<Job>

Reschedule a delayed job relative to now.

Source

pub async fn retry(&self, job_id: &str, now: DateTime<Utc>) -> Result<Job>

Manually retry a failed job by moving it back to the waiting state.

Source

pub async fn renew( &self, job_id: &str, lock_token: &str, lease_for: Duration, now: DateTime<Utc>, ) -> Result<Job>

Renew the active worker lease for a job.

Source

pub async fn delay_active( &self, job_id: &str, lock_token: &str, delay: Duration, now: DateTime<Utc>, ) -> Result<Job>

Move an active leased job back to delayed state.

Source

pub async fn release_active( &self, job_id: &str, lock_token: &str, now: DateTime<Utc>, ) -> Result<Job>

Release an active leased job back to waiting state.

Source

pub async fn set_priority( &self, job_id: &str, priority: JobPriority, ) -> Result<Job>

Update an existing job priority.

Source

pub async fn set_priority_with_lifo( &self, job_id: &str, priority: JobPriority, lifo: bool, ) -> Result<Job>

Update an existing job priority and waiting reinsert order.

Source

pub async fn list(&self, options: JobListOptions) -> Result<JobListPage>

List jobs with deterministic pagination.

Source

pub async fn counts_by_state( &self, states: &[JobState], ) -> Result<Vec<JobStateCount>>

Count jobs for requested lifecycle states.

Source

pub async fn counts_per_priority( &self, priorities: &[JobPriority], ) -> Result<Vec<JobPriorityCount>>

Count waiting jobs for each requested priority.

Source

pub async fn clean( &self, state: JobState, grace: Duration, limit: usize, now: DateTime<Utc>, ) -> Result<Vec<Job>>

Remove old jobs in a specific state and return their snapshots.

Source

pub async fn drain(&self, include_delayed: bool) -> Result<Vec<Job>>

Drain waiting jobs and optionally non-repeat delayed jobs.

Source

pub async fn obliterate(&self, force: bool) -> Result<usize>

Remove every job and queue-owned metadata entry.

Source

pub async fn set_data(&self, job_id: &str, payload: Value) -> Result<Job>

Update the stored payload for an existing job.

Source

pub async fn set_progress(&self, job_id: &str, progress: Value) -> Result<Job>

Update progress for an existing job.

Source

pub async fn save_stacktrace( &self, job_id: &str, stacktrace: Vec<String>, failed_reason: String, ) -> Result<Job>

Save retained failure diagnostics for a job.

Source

pub async fn log( &self, job_id: &str, line: String, keep: usize, now: DateTime<Utc>, ) -> Result<Job>

Append a log line. keep == 0 retains all log lines.

Source

pub async fn get_logs( &self, job_id: &str, start: isize, end: isize, ascending: bool, ) -> Result<JobLogPage>

Return retained log entries for a job.

Source

pub async fn clear_logs(&self, job_id: &str, keep: usize) -> Result<JobLogPage>

Clear retained log entries for a job. keep == 0 clears all logs.

Trait Implementations§

Source§

impl Clone for InMemoryJobQueue

Source§

fn clone(&self) -> InMemoryJobQueue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryJobQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl JobQueueBackend for InMemoryJobQueue

Source§

fn add_job<'life0, 'async_trait>( &'life0 self, name: String, payload: Value, options: JobOptions, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn add_jobs<'life0, 'async_trait>( &'life0 self, jobs: Vec<JobSpec>, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add multiple jobs, preserving input order and add_job idempotency semantics.
Source§

fn add_flow<'life0, 'async_trait>( &'life0 self, parent: JobSpec, children: Vec<JobSpec>, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<JobFlow>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn add_flow_children<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_id: &'life1 str, lock_token: &'life2 str, children: Vec<JobSpec>, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add children to an active parent and move that parent to waiting_children. Read more
Source§

fn get_flow_dependencies<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencies>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_flow_dependency_counts<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencyCounts>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_flow_dependency_selected_counts<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, options: JobFlowDependencyCountOptions, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencySelectedCounts>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return selected BullMQ-style dependency counts for a flow parent.
Source§

fn get_flow_dependency_values<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencyValues>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return BullMQ-style full dependency buckets for a flow parent.
Source§

fn get_flow_dependency_page<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, options: JobFlowDependencyPageOptions, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencyPage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return one cursor page from a parent flow dependency bucket.
Source§

fn get_flow_dependency_pages<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, options: JobFlowDependencyPagesOptions, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowDependencyPages>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return cursor pages from several parent flow dependency buckets.
Source§

fn get_flow_children_values<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowChildValues>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return completed child result values for a flow parent. Read more
Source§

fn get_flow_ignored_children_failures<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFlowIgnoredFailures>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return ignored child failure reasons for a flow parent. Read more
Source§

fn remove_unprocessed_children<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Job>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn remove_child_dependency<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn claim_next<'life0, 'async_trait>( &'life0 self, worker_id: JobWorkerId, lease_for: Duration, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_job<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, value: Value, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fail_job<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, error: String, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fail_job_discarding_retry<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, error: String, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fail an active job without applying its automatic retry policy. Read more
Source§

fn renew_lease<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, lease_for: Duration, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn delay_active_job<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, delay: Duration, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn release_active_job<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, job_id: &'life1 str, lock_token: &'life2 str, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn promote_job<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn reschedule_job<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, delay: Duration, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn retry_job<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reprocess a retained failed or completed job by moving it back to waiting.
Source§

fn update_priority<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, priority: JobPriority, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update an existing job’s stored priority. Read more
Source§

fn update_priority_with_lifo<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, priority: JobPriority, lifo: bool, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update priority and choose how the job is reinserted within the same-priority group. Read more
Source§

fn remove_job<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn remove_repeat<'life0, 'life1, 'async_trait>( &'life0 self, repeat_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn remove_deduplication_key<'life0, 'life1, 'async_trait>( &'life0 self, deduplication_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_deduplication_job_id<'life0, 'life1, 'async_trait>( &'life0 self, deduplication_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_repeats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<JobRepeatEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn upsert_repeat<'life0, 'async_trait>( &'life0 self, spec: JobSpec, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create or replace the current non-active occurrence for a repeat series. Read more
Source§

fn clean_jobs<'life0, 'async_trait>( &'life0 self, state: JobState, grace: Duration, limit: usize, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn drain_jobs<'life0, 'async_trait>( &'life0 self, include_delayed: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn obliterate<'life0, 'async_trait>( &'life0 self, force: bool, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove all queue data. Read more
Source§

fn list_jobs<'life0, 'async_trait>( &'life0 self, options: JobListOptions, ) -> Pin<Box<dyn Future<Output = Result<JobListPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_job_counts<'life0, 'life1, 'async_trait>( &'life0 self, states: &'life1 [JobState], ) -> Pin<Box<dyn Future<Output = Result<Vec<JobStateCount>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return counts for the requested states. Read more
Source§

fn get_counts_per_priority<'life0, 'life1, 'async_trait>( &'life0 self, priorities: &'life1 [JobPriority], ) -> Pin<Box<dyn Future<Output = Result<Vec<JobPriorityCount>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return waiting-job counts for the requested priorities. Read more
Source§

fn update_data<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, payload: Value, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn update_progress<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, progress: Value, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update an existing job’s stored progress and emit a progress event. Read more
Source§

fn save_stacktrace<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, stacktrace: Vec<String>, failed_reason: String, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save retained failure diagnostics for a job. Read more
Source§

fn add_log<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, line: String, keep: usize, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Job>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_job_logs<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, start: isize, end: isize, ascending: bool, ) -> Pin<Box<dyn Future<Output = Result<JobLogPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn clear_job_logs<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, keep: usize, ) -> Pin<Box<dyn Future<Output = Result<JobLogPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Clear retained job logs, optionally keeping the newest entries. Read more
Source§

fn read_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, start: &'life1 str, end: &'life2 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<JobEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Read retained queue events in stream-id order. Read more
Source§

fn trim_events<'life0, 'async_trait>( &'life0 self, max_len: usize, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trim retained queue events to approximately max_len entries.
Source§

fn promote_due_jobs<'life0, 'async_trait>( &'life0 self, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn recover_stalled_jobs<'life0, 'async_trait>( &'life0 self, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pause<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn resume<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn is_paused<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return whether this queue is currently paused.
Source§

fn get_job<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_job_state<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobState>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_job_finished_result<'life0, 'life1, 'async_trait>( &'life0 self, job_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobFinishedResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return whether a retained job has finished and include its terminal payload. Read more
Source§

fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<JobQueueStats>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn claim_next_blocking<'life0, 'async_trait>( &'life0 self, worker_id: JobWorkerId, lease_for: Duration, _block_for: Duration, ) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Claim the next job, optionally waiting for backend-native work signals. Read more
Source§

fn renew_leases<'life0, 'life1, 'async_trait>( &'life0 self, renewals: &'life1 [JobLeaseRenewal], lease_for: Duration, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<JobId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Renew multiple active job leases. Read more
Source§

fn get_repeat<'life0, 'life1, 'async_trait>( &'life0 self, repeat_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<JobRepeatEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return one repeat series / job scheduler by key.
Source§

fn count_repeats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the number of current repeat series / job schedulers.
Source§

fn list_repeats_page<'life0, 'async_trait>( &'life0 self, options: JobRepeatListOptions, ) -> Pin<Box<dyn Future<Output = Result<JobRepeatPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return repeat series / job schedulers with BullMQ-style pagination. Read more
Source§

fn get_job_count<'life0, 'life1, 'async_trait>( &'life0 self, states: &'life1 [JobState], ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the aggregate count for the requested states. Read more
Source§

fn count_pending_jobs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return jobs that are waiting to be processed. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more