Skip to main content

run

Function run 

Source
pub fn run<A>(
    config: ServerConfig,
    startup: StartupEvents<A::Event>,
    sizing: A::Sizing,
    decoder: impl RequestDecoder<Event = A::Event> + 'static,
    encoder: impl ResponseEncoder<Report = A::Report, Query = A::QueryResponse> + 'static,
    event_publisher: Option<EventPublisherFn<A>>,
) -> Result<(), Box<dyn Error>>
where A: Application + Send + 'static, A::Event: Send + Sync + 'static, A::Report: Send + 'static, A::QueryResponse: Send + 'static,
Expand description

Run the server with automatic transport selection.

Installs SIGINT/SIGTERM handlers, optionally locks memory, selects the transport (DPDK under the dpdk feature, kernel TCP otherwise), and enters the pipeline loop. This is the main entry point for application binaries.

The application starts from A::default() on every node; startup is what the node journals on top of that as it becomes primary — see StartupEvents. sizing is what this node reserves memory for, handed to Application::prefault on every instance the node builds; it is local to the node and never journaled.

For callers that need a pre-bound listener or an externally controlled shutdown flag (e.g. benchmarks), use run_with_listener instead.