oban-essentials
Installation
SKILL.md
Oban Essentials
RULES — Follow these with no exceptions
- Always
use Oban.Workerwith explicitqueueandmax_attemptsoptions - Return
{:ok, result}for success,{:error, reason}for retryable failures,{:cancel, reason}for permanent failures — prefer{:ok, result}over bare:okfor explicit intent (bare:okis supported), and prefer{:error, reason}over raising - Make workers idempotent — the same job may run more than once due to retries or node restarts
- Use
uniqueoption to prevent duplicate jobs — specifyperiod,fields, andkeys - Test with
Oban.Testing— useassert_enqueuedandperform_job, never callperform/1directly - Never put large data in job args — store IDs and fetch fresh data in the worker
- Use
Oban.insert/1(notOban.insert!/1) and handle the error tuple