Expand description
Cross-thread ring queues used between the worker, gossip, and stats threads.
The C engine uses two SPSC ring buffers, C2G_InQ and C2G_OutQ,
sized at 256 slots each. The Rust port replaces them with bounded
crossbeam_channel pairs of the same 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.