A high-performance, concurrent job queue system for Elixir applications. ExFastQueue provides a simple yet powerful way to process background jobs with configurable concurrency and persistence.
Add ex_fast_queue to your list of dependencies in mix.exs:
def deps do
[
{:ex_fast_queue, "~> 0.1.0"}
]
end- Configure your queues in
config/config.exs:
config :my_app, ExFastQueue, queues: [
{:pix_process, fun: &MyApp.PixProcessor.process/1},
{:emails, fun: &MyApp.EmailWorker.process/1}
]- Start the queue supervisor in your application's supervision tree:
children = [
{ExFastQueue, Application.get_env(:my_app, ExFastQueue)}
# ... other children
]
Supervisor.start_link(children, strategy: :one_for_one)- Enqueue jobs from anywhere in your application:
# Enqueue a job with custom attributes
ExFastQueue.Queue.enqueue(:pix_process, %{user_id: 123, amount: 100.0})
ExFastQueue.Queue.enqueue(:emails, %{to: "[email protected]", template: "welcome"})Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_fast_queue.