Module queues

Source
Expand description

Queue backend abstraction layer.

This module provides a backend-agnostic interface for job queue operations. Implementations can use Redis/Apalis (current) or AWS SQS (new) as the backend.

§Environment Variables

  • QUEUE_BACKEND: Backend to use (“redis” or “sqs”, 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
let workers = backend.initialize_workers(app_state).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§

errors
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§

QueueBackendStorage
Enum-based queue backend storage, following the codebase convention used by SignerRepositoryStorage, NetworkRepositoryStorage, etc.
QueueBackendType
Supported queue backend implementations.

Traits§

QueueBackend
Queue backend abstraction trait.

Functions§

create_queue_backend
Creates a queue backend based on the QUEUE_BACKEND environment variable.