Skip to content

3.0: consolidate the claim API and worker builders #89

Closed

Description

@CodingAnarchy

The API grew piecemeal and can be simplified now that breaking changes are allowed:

  • Claim methods: dequeue, dequeue_with_priority_weights, dequeue_leased, dequeue_batch and dequeue_batch_leased could become one dequeue(&DequeueOptions { weights, lease, max_jobs }). Keep thin helpers only if they make the common case clearer.
  • Batch mode: with_batch_processing_enabled overlaps with with_batch_size (2.1). Keep with_batch_size, and move batch settings into WorkerConfig (see 3.0: mark public config and stats structs #[non_exhaustive] #81).
  • Worker::with_max_retries: it can only lower a job's attempt limit (finding M2 in Final hardening review findings #64), which the name doesn't suggest. Rename it, for example to with_attempt_cap.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions