Expand description
Queue backend abstraction layer.
This module provides a backend-agnostic interface for job queue operations. Implementations can use Redis/Apalis, AWS SQS, or GCP Pub/Sub as the backend.
§Environment Variables
QUEUE_BACKEND: Backend to use (“redis”, “sqs”, or “pubsub” / “gcp-pubsub”, default: “redis”)
§Example
ⓘ
// Create backend from environment
let backend = create_queue_backend(redis_connections).await?;
// Produce a job
backend.produce_transaction_request(job, None).await?;
// Initialize workers on the pipeline runtime
let workers = backend.initialize_workers(app_state, handle).await?;Re-exports§
pub use errors::QueueBackendError;pub use queue_type::QueueType;pub use redis::queue::Queue;pub use retry_config::backoff_config_for_queue;pub use retry_config::retry_delay_secs;pub use retry_config::status_check_retry_delay_secs;pub use swap_filter::filter_relayers_for_swap;pub use worker_types::HandlerError;pub use worker_types::QueueHealth;pub use worker_types::WorkerContext;pub use worker_types::WorkerHandle;
Modules§
- cron
- Backend-neutral cron scheduler for dumb-pipe queue backends (SQS, Pub/Sub).
- errors
- pubsub
- GCP Pub/Sub queue backend façade and re-exports for the queue abstraction.
- queue_
type - redis
- Redis queue backend façade and re-exports for the queue abstraction.
- retry_
config - sqs
- AWS SQS queue backend façade and re-exports for the queue abstraction.
- swap_
filter - worker_
types - Worker types for the queue abstraction.
Enums§
- Queue
Backend Storage - Enum-based queue backend storage, following the codebase convention
used by
SignerRepositoryStorage,NetworkRepositoryStorage, etc. - Queue
Backend Type - Supported queue backend implementations.
Traits§
- Queue
Backend - Queue backend abstraction trait.
Functions§
- create_
queue_ backend - Creates a queue backend based on the QUEUE_BACKEND environment variable.