Skip to content

Install

  1. Add the dependencies.

    Cargo.toml
    [dependencies]
    queuey = "0.2"
    serde = { version = "1", features = ["derive"] }
    tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
  2. Import the prelude. One use brings in the derives, the traits they implement, the runtime and the handful of foreign items your code cannot avoid naming.

    use queuey::prelude::*;
  3. Check your toolchain. queuey needs Rust 1.88 or newer and builds on edition 2024.

    Terminal window
    rustc --version

There is one, on the facade crate:

Feature Default Effect
rabbitmq yes Pulls in queuey-rabbitmq and re-exports RabbitMqBackend, RabbitMqOptions and the rabbitmq module

Turning it off leaves the core, the macros and MemoryBackend, which is enough for tests or for a backend of your own:

Cargo.toml
[dependencies]
queuey = { version = "0.2", default-features = false }

use queuey::prelude::* gives you:

  • the two derives, Queues and Job;
  • the traits they implement, QueueSet and Job;
  • the runtime: Producer, Worker, WorkerBuilder, WorkerHandle, JobHandler, FnHandler, JobContext, JobError;
  • the configuration types: QueueConfig, RetryPolicy, Backoff, DEFAULT_MAX_PRIORITY;
  • MemoryBackend, and RabbitMqBackend when the feature is on;
  • the three foreign items user code cannot avoid naming: async_trait, Serialize and Deserialize, and Arc.

Items the prelude leaves out, because most code never names them, are still available from the crate root: Error, Result, Envelope, RetryDecision, Backend, Delivery, DeliveryStream.

You only ever depend on queuey. The derives resolve their own paths through the facade, so there is no crate = "..." attribute to write and no direct dependency on the core crate.

Crate Role API docs
queuey Facade: prelude, re-exports, examples docs.rs
queuey-core Traits, Producer, Worker, retry policies, MemoryBackend docs.rs
queuey-macros #[derive(Queues)], #[derive(Job)] docs.rs
queuey-rabbitmq RabbitMqBackend on lapin docs.rs

The RabbitMQ backend talks to any 3.x or 4.x broker. For local work:

Terminal window
docker run --rm -d -p 5672:5672 -p 15672:15672 rabbitmq:4-management

The management UI is then on http://localhost:15672 with guest / guest, which is worth having open the first time you watch retries and hold queues appear.

You do not need it to get started: MemoryBackend runs the same code with no broker at all.