Fleet is a high-throughput, zero-bloat background job processing engine
for Elixir powered by PgQue and Broadway.
Enqueueing Jobs
# Direct enqueue
%{user_id: 123}
|> MyApp.Workers.WelcomeEmail.new()
|> Fleet.insert(MyApp.Repo)
# Within an Ecto transaction (Transactional Outbox)
Ecto.Multi.new()
|> Ecto.Multi.insert(:user, user_changeset)
|> Fleet.insert(:welcome_email, fn %{user: user} ->
MyApp.Workers.WelcomeEmail.new(%{user_id: user.id})
end)
|> MyApp.Repo.transaction()
Summary
Functions
Returns a child specification to start Fleet within a supervision tree.
Returns consumer subscription information for all queues or a specific consumer.
Inspects dead-lettered events for a given queue.
Returns the default repository configured for Fleet via config :fleet, repo: MyApp.Repo.
Returns the default repository or raises an ArgumentError.
Inserts a Fleet.Job into the queue using the default configured repository (config :fleet, repo: MyApp.Repo).
Inserts a Fleet.Job into the queue with options using the default repository,
or inserts using an explicit repository (supports both insert(repo, job) and job |> insert(repo)).
Inserts a Fleet.Job directly into the database or appends an operation to an Ecto.Multi.
Inserts a Fleet.Job directly into the queue using the default repository, raising on failure.
Inserts a Fleet.Job directly into the queue, raising on failure.
Inserts multiple Fleet.Jobs using the default repository.
Inserts multiple Fleet.Jobs into their respective queues or appends a batch operation to Ecto.Multi.
Inserts multiple Fleet.Jobs into their respective queues using default repository, raising on failure.
Inserts multiple Fleet.Jobs into their respective queues, raising on failure.
Returns a consolidated metadata overview across all queues, consumers, DLQs, and retries. Perfect for web dashboards, LiveView UIs, and monitoring endpoints.
Disables event insertion into the given queue.
Pauses the ticker for the given queue.
Purges all dead letter entries for a given queue.
Returns detailed metadata for a specific queue or all queues.
Replays all dead letter entries for a given queue back into its active queue.
Replays a single dead letter entry back into its active queue.
Re-enables event insertion into the given queue.
Resumes the ticker for the given queue.
Inspects retry/scheduled events for a given queue.
Notifies the Broadway producer(s) for the specified queue to wake up immediately.
Functions
Returns a child specification to start Fleet within a supervision tree.
Returns consumer subscription information for all queues or a specific consumer.
Inspects dead-lettered events for a given queue.
Returns the default repository configured for Fleet via config :fleet, repo: MyApp.Repo.
Returns the default repository or raises an ArgumentError.
@spec insert(Fleet.Job.t()) :: {:ok, Fleet.Job.t()} | {:error, term()}
Inserts a Fleet.Job into the queue using the default configured repository (config :fleet, repo: MyApp.Repo).
Inserts a Fleet.Job into the queue with options using the default repository,
or inserts using an explicit repository (supports both insert(repo, job) and job |> insert(repo)).
@spec insert( Fleet.Client.repo_or_conn() | Ecto.Multi.t(), Fleet.Job.t() | term(), keyword() | Fleet.Job.t() | (map() -> Fleet.Job.t()) ) :: {:ok, Fleet.Job.t()} | {:error, term()} | Ecto.Multi.t()
Inserts a Fleet.Job directly into the database or appends an operation to an Ecto.Multi.
@spec insert!(Fleet.Job.t()) :: Fleet.Job.t()
Inserts a Fleet.Job directly into the queue using the default repository, raising on failure.
@spec insert!(Fleet.Client.repo_or_conn(), Fleet.Job.t(), keyword()) :: Fleet.Job.t()
Inserts a Fleet.Job directly into the queue, raising on failure.
Inserts multiple Fleet.Jobs using the default repository.
@spec insert_all( Fleet.Client.repo_or_conn() | Ecto.Multi.t(), [Fleet.Job.t()] | term(), keyword() | [Fleet.Job.t()] | (map() -> [Fleet.Job.t()]) ) :: {:ok, [Fleet.Job.t()]} | {:error, term()} | Ecto.Multi.t()
Inserts multiple Fleet.Jobs into their respective queues or appends a batch operation to Ecto.Multi.
Inserts multiple Fleet.Jobs into their respective queues using default repository, raising on failure.
@spec insert_all!(Fleet.Client.repo_or_conn(), [Fleet.Job.t()], keyword()) :: [ Fleet.Job.t() ]
Inserts multiple Fleet.Jobs into their respective queues, raising on failure.
@spec overview(Fleet.Client.repo_or_conn() | nil) :: {:ok, map()} | {:error, term()}
Returns a consolidated metadata overview across all queues, consumers, DLQs, and retries. Perfect for web dashboards, LiveView UIs, and monitoring endpoints.
Disables event insertion into the given queue.
Pauses the ticker for the given queue.
Purges all dead letter entries for a given queue.
Returns detailed metadata for a specific queue or all queues.
Replays all dead letter entries for a given queue back into its active queue.
Replays a single dead letter entry back into its active queue.
Re-enables event insertion into the given queue.
Resumes the ticker for the given queue.
Inspects retry/scheduled events for a given queue.
Notifies the Broadway producer(s) for the specified queue to wake up immediately.