We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
This feature integrates Oban, Elixir's robust background job processing library, into your Phoenix application with complete setup automation. It handles all configuration, database migrations, and testing infrastructure needed to start processing background jobs immediately.
Key Benefits
Implementation Details The tool automatically installs the Oban dependency and configures four distinct queues with different concurrency levels. It integrates Oban into your application's supervision tree and sets up essential plugins including job pruning (24-hour retention) and cron scheduling. Database migrations are generated to create the required jobs table, while test environments are configured with manual testing mode to prevent job execution during tests.
Usage Example
defmodule MyApp.EmailWorker do
use Oban.Worker, queue: :mailers, max_attempts: 3
@impl Oban.Worker
def perform(%Oban.Job{args: %{"user_id" => user_id}}) do
user = MyApp.Accounts.get_user!(user_id)
MyApp.Mailer.send_welcome_email(user)
:ok
end
end
# Enqueue jobs
%{user_id: 123}
|> MyApp.EmailWorker.new()
|> Oban.insert()
Configuration Queue concurrency is pre-configured with sensible defaults: 10 for default jobs, 20 for mailers, 50 for high priority, and 5 for low priority tasks. Cron scheduling is enabled but requires you to add specific job schedules to the crontab configuration as needed.