hyperlane-plugin-mq 22.14.0

A message queue plugin for the Hyperlane framework providing a pluggable MessageBroker trait and an in-memory broker with consumer groups, visibility timeouts, retries, TTL expiration, and dead-letter queues.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

/// Boxed `Send` future returned by async [`MessageBroker`] trait methods.
pub type BrokerFuture<'a, T> = Pin<Box<dyn Future<Output = Result<T, MqError>> + Send + 'a>>;

/// Thread-safe shared reference to any [`MessageBroker`] backend implementation.
pub type SharedBroker = Arc<dyn MessageBroker>;

/// Fast zero-dependency FNV-1a hash map used inside broker shards and topics.
pub(crate) type FnvHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FnvHasher>>;

/// Fixed-size sharded topic lookup array.
pub(crate) type TopicShardArray =
    Box<[RwLock<FnvHashMap<String, Arc<TopicBroker>>>; MQ_SHARD_COUNT]>;

/// Lock-free O(1) topic-id to [`TopicBroker`] lookup table.
pub(crate) type FastTopicTable = Box<[OnceLock<Arc<TopicBroker>>; MQ_FAST_TOPIC_SLOTS]>;