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 journal writer. - Builds the disruptor pipeline (input ring + output ring).
- Spawns 3-5 OS threads: journal, matching, response, [repl-accept], [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::layout::PipelineCores;pub use crate::layout::Placement;pub use crate::layout::ReaderThread;pub use crate::ControlEvent;
Structs§
- Server
Config - Server configuration, parsed from CLI arguments via clap.
Enums§
- Journal
Staging Mode - CLI spelling of
melin_journal::StagingMode.
Functions§
- run
- Run the server with automatic transport selection.
- run_
with_ listener - Run the server with a caller-supplied listener.
- run_
with_ shutdown run, stopped throughshutdownrather than by a signal: the same transport selection and the same startup, but no SIGINT/SIGTERM handler is installed. Setshutdowntotruefor a clean shutdown; the node may also set it itself (a fenced node stops this way).
Type Aliases§
- Event
Publisher Fn - Body of the event-publisher thread: a free function with this exact signature (an application with an output feed supplies its publisher; one without supplies nothing). Passing it as a function pointer keeps the runtime decoupled from the application — no application reference inside server.rs — without paying for a boxed closure.