1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2026 Praxis Contributors
//! The server runtime contract a network backend implements.
use Pin;
use crateConfig;
// -----------------------------------------------------------------------------
// Types
// -----------------------------------------------------------------------------
/// A boxed, sendable future the runtime waits on for a shutdown request.
pub type ShutdownFuture = ;
// -----------------------------------------------------------------------------
// ServerRuntime
// -----------------------------------------------------------------------------
/// Owns the process's async runtime, its listening services and shutdown.
///
/// Protocol adapters bind their listeners onto the runtime (the `Protocol`
/// trait in `praxis-proxy-protocol`), background services hang off it, and
/// then exactly one of the `run_*` methods takes over the calling thread
/// until the server has stopped. Nothing is bound until a protocol registers.
///
/// ```
/// use praxis_core::{
/// config::{Config, DEFAULT_CONFIG},
/// server::{ServerRuntime as _, UnavailableRuntime},
/// };
///
/// let config = Config::from_yaml(DEFAULT_CONFIG).unwrap();
/// let runtime = UnavailableRuntime::from_config(&config);
/// runtime.run_with_shutdown(Box::pin(std::future::ready(())));
/// ```