disrupt-rs
Low latency inter-thread communication via a ring buffer, inspired by the LMAX Disruptor.
Quickstart
Add to Cargo.toml:
= "1.0.0"
Managed threads
use ;
let factory = ;
let handler = ;
let mut producer = build_single_producer
.handle_events_with
.build;
for i in 0..10
Event poller
use ;
let factory = default;
let builder = build_single_producer;
let = builder.event_poller;
let mut producer = builder.build;
producer.publish;
drop;
loop
How it fits together
flowchart LR
P1[Producer] -->|publish| RB[Ring Buffer]
P2[Producer] -->|publish| RB
RB --> C1[Consumer]
RB --> C2[Consumer]
RB --> EP[Event Poller]
Examples
See examples/ for runnable end-to-end examples.
Attribution
This crate is forked from https://github.com/nicholassm/disruptor-rs.