adapter
ModuleUndocumented.
Contents
use utopia_queue::adapter::Adapter;pub struct AdapterThe transport side of a worker server: its consumer (or a factory), how many workers run, the queue namespace, and the static resources.
use utopia_queue::adapter::Spec;pub struct SpecOne queue to consume: identity, handler concurrency, prefetch and consumer.
use utopia_queue::adapter::Stopper;pub struct Stopper(Arc<AtomicBool>)Stops an Adapter's consume loops (Adapter::stopper).
use utopia_queue::adapter::Runtime;pub enum RuntimeHow the consume loops run.
pub type ConsumerFactory = Arc<dyn Fn(&str) -> Arc<dyn Consumer> + Send + Sync>Makes a consumer for a queue name ('' for the adapter's own).
pub type ErrorCallback = Arc<dyn Fn(Option<Arc<Message>>, Error, Arc<Resources>) -> BoxFuture<'static, Result<()>> + Send + Sync>Reports a failure: with the message, or None when obtaining one failed.
pub type MessageCallback = Arc<dyn Fn(Arc<Message>, Arc<Resources>) -> BoxFuture<'static, Result<()>> + Send + Sync>Runs a message's handler; its result decides commit or reject.
Each callback gets the message's context: a child of the static resources, created per message and dropped once it is settled.
pub type SuccessCallback = Arc<dyn Fn(Arc<Message>, Arc<Resources>) -> BoxFuture<'static, Result<()>> + Send + Sync>Runs after a message is committed.
pub const MAINTENANCE_INTERVAL: f64 = 30.0Seconds between idle-upkeep sweeps of a running worker.
pub const RECEIVE_BACKOFF: u64 = 1Seconds to wait after the broker failed to answer.
pub const RECEIVE_TIMEOUT: i64 = 2Seconds a receive waits for the first message.