Expand description
Runtime-neutral queue seam with an in-memory conformance adapter.
This crate defines contracts only and stays dependency free. Vendor
adapters for NATS, RabbitMQ, Kafka, and SQS live in separate adapter
packages outside this repository and implement Queue there.
MemoryQueue exists for tests and local development, and Worker
supplies the retry, backoff, and dead-letter policy every adapter shares.
The seam is deliberately cross-thread. QueueFuture carries a Send
bound and Queue requires Send + Sync so a Worker can run on a
multi-threaded pool next to the thread-per-core HTTP path. Operation
handlers stay unaffected: a Send future is usable from the framework’s
thread-local executor, so publishing from a handler still compiles. An
adapter that can only run on one thread must own that thread internally and
hand back a Send future.
Structs§
- Delivery
- One at-least-once delivery.
- JobError
- Failure returned by a worker job handler.
- Memory
Queue - Deterministic in-memory adapter for tests and local development.
- Message
- Queue payload shared by vendor adapters.
- Queue
Client - Cloneable DI wrapper that keeps application code vendor-neutral.
- Retry
Policy - Bounded exponential backoff applied between delivery attempts.
- Worker
- Runtime-neutral consumer loop over one
Queuetopic.
Enums§
- Dead
Letter - Destination for deliveries that exhausted their attempts.
- Queue
Error - Worker
Step - Outcome of one
Worker::stepcycle.
Constants§
- DEAD_
LETTER_ ATTEMPT_ HEADER - Header carrying the attempt count of a dead-lettered delivery.
- DEAD_
LETTER_ REASON_ HEADER - Header carrying the last handler failure of a dead-lettered delivery.
- DEAD_
LETTER_ SOURCE_ HEADER - Header naming the topic a dead-lettered delivery came from.
Traits§
- Queue
- Adapter surface implemented by NATS,
RabbitMQ, Kafka, SQS, and test queues.