Skip to main content

melin_server_runtime/
lib.rs

1//! Application-agnostic LMAX-pipeline server runtime.
2//!
3//! Groups the application-agnostic parts of the Melin server: the
4//! accept loop, frame reader, durability-policy wiring, admin
5//! endpoint, replication, and the optional DPDK transport. Generic
6//! over `A: Application` — the binary supplies a concrete app via
7//! [`server::run`] (or [`server::run_dpdk`] under `feature = "dpdk"`) along with caller-supplied
8//! `AppFactory`, `RequestDecoder`, `ResponseEncoder`, and event-
9//! publisher fn.
10//!
11//! The trading-side wiring (`ServerApp`, `ExchangeRequestDecoder`,
12//! `ExchangeResponseEncoder`, market-data firehose) lives in the
13//! separate `melin-server` crate.
14
15pub mod admin;
16mod client_frames;
17pub mod durability_policy;
18pub mod process;
19pub mod reader;
20pub mod replication;
21pub mod response;
22pub mod server;
23
24#[cfg(feature = "dpdk")]
25pub mod dpdk_response;
26#[cfg(feature = "dpdk")]
27pub mod dpdk_transport;
28
29/// Control-plane event the accept loop and response stage exchange.
30/// Transport-agnostic — the payload is a socket fd + writer, not an
31/// app event — so both build modes refer to the same type.
32pub enum ControlEvent {
33    Connected {
34        connection_id: u64,
35        fd: std::os::unix::io::RawFd,
36        writer: melin_wire_protocol::blocking::BlockingFrameWriter<Box<dyn std::io::Write + Send>>,
37    },
38    Disconnected {
39        connection_id: u64,
40    },
41}