Details

Language / Topic
rubyRuby
Category
Libraries
Source
sidekiq

Rules

balanced
- Define workers with `include Sidekiq::Job` and implement `perform()` — keep arguments simple (strings, integers) since they're serialized to JSON.
- Use `perform_async()` for background processing and `perform_in(5.minutes)` for delayed jobs — never call `perform()` directly in production.
- Make jobs idempotent — Sidekiq retries failed jobs automatically, so `perform()` must produce the same result when called multiple times.
- Use `sidekiq_options queue: "critical", retry: 5` for queue and retry configuration.
- Use `perform_async` for background execution, `perform_in` for delayed execution.
- Keep jobs idempotent — they may be retried on failure. Design for safe re-execution.
- Use `Sidekiq::Batch` for coordinating groups of related jobs with callbacks.