Skip to main content

run

Function run 

Source
pub fn run<A, F, D, E>(
    config: ServerConfig,
    factory: F,
    decoder: D,
    encoder: E,
    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, F: AppFactory<App = A> + 'static, D: RequestDecoder<Event = A::Event> + 'static, E: ResponseEncoder<Report = A::Report, Query = A::QueryResponse> + '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.

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