Skip to main content

claim

Function claim 

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

Atomically claim the next eligible job for a specific worker.

Like claim_next_job but records the worker_id and sets heartbeat_at. Only considers jobs whose next_run_at is NULL or in the past.