Skip to main content

claim_next_job

Function claim_next_job 

Source
pub fn claim_next_job(
    conn: &Connection,
) -> Result<Option<(String, Value)>, Error>
Expand description

Atomically claim the next pending job by selecting and marking it as processing in a single transaction. Returns the job ID and its data, or None if no pending jobs are available.

This prevents race conditions where two executors could claim the same job.