Expand description
Cross-thread ring queues used between the worker, gossip, and stats threads.
Two SPSC ring queues, C2G_InQ and C2G_OutQ, sized at 256
slots each, carry messages between the core and gossip threads.
They are implemented as bounded crossbeam_channel pairs of
that capacity. The RingChannels struct owns both directions
(core -> gossip and gossip -> core), so callers receive a single
value to wire into their thread spawning code.
§Examples
use dynomite::core::ring_queue::RingChannels;
let chans: RingChannels<u32, u32> = RingChannels::new();
chans.in_tx.send(7).unwrap();
assert_eq!(chans.in_rx.recv().unwrap(), 7);
chans.out_tx.send(11).unwrap();
assert_eq!(chans.out_rx.recv().unwrap(), 11);Structs§
- Ring
Channels - A pair of bounded channels that carry the core <-> gossip ring traffic.
Constants§
- C2G_
IN_ CAPACITY - Maximum in-flight ring messages for the core -> gossip direction.
- C2G_
OUT_ CAPACITY - Maximum in-flight ring messages for the gossip -> core direction.