Skip to main content

get_next_pending

Function get_next_pending 

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

Get the next pending job (highest priority, oldest first). Returns the job ID and its data as a JSON value.

Note: Prefer claim_next_job for executor use — it atomically selects and marks the job as processing in a single transaction, preventing race conditions when multiple executors share a database.