claim

open suspend override fun claim(queues: List<QueueName>, kinds: Set<String>, limit: Int, lease: Duration, worker: WorkerId): List<ClaimedJob>

Claims up to limit due jobs for worker under a lease of lease, scanning queues in list order (declared order is priority) and returning only jobs whose kind is in kinds. Rows of any other kind are left untouched: not claimed, not transitioned, not counted against limit. An empty kinds returns an empty list. The filter is what lets a worker that does not bind a kind (an older version mid-rollout, a fleet that drains a shared queue for a subset of kinds) leave that job for a worker that does.

Atomic across concurrent callers: a row is claimed by exactly one worker per lease window, in a single statement (SKIP LOCKED or CAS), never an in-process check. Each claim bumps the row's attempt and fence. Due-ness is decided by the store's clock.