Expand description
Server orchestrator — binds the accept loop, pipeline threads, and reader.
On startup:
- Recovers or creates the
JournaledApp<A>. - Decomposes it into
(A, W)viainto_parts(), whereWis the writer selected by--journal-writer. - Builds the disruptor pipeline (input ring + output ring).
- Spawns 3-5 OS threads: journal, matching, response, [repl-sender], [event-publisher].
- Runs the accept loop, registering connections with the io_uring reader.
Fully synchronous — no async runtime needed. Reader threads use io_uring with multishot RECV to multiplex connections, eliminating thread oversubscription. The response thread writes via io_uring SEND.
Re-exports§
pub use crate::ControlEvent;
Structs§
- Pipeline
Cores - Core assignments for pipeline threads.
- Server
Config - Server configuration, parsed from CLI arguments via clap.
Functions§
- run
- Run the server with automatic transport selection.
- run_
with_ listener - Run the server with a caller-supplied listener.
Type Aliases§
- Event
Publisher Fn - Body of the event-publisher thread: a free function with this exact
signature (the trading binary supplies
melin_server::event_publisher::run; the skip-order-exec binary supplies nothing). Passing it as a function pointer keeps the runtime decoupled from the trading domain — nomelin_server::*reference inside server.rs — without paying for a boxed closure.