pub struct Workload {
pub tick_rate: u32,
pub peak_players: usize,
pub ops_per_player_per_tick: u32,
pub stall_tolerance: Duration,
pub join_burst: usize,
pub tick_budget: Option<Duration>,
pub max_payload: usize,
pub memory_budget: Option<usize>,
pub priority: Priority,
pub socket_buffer_bytes: usize,
}Expand description
What an application does, in the terms its author already knows.
Fields§
§tick_rate: u32How often the server broadcasts, in Hz.
peak_players: usizeConnections held at once.
ops_per_player_per_tick: u32Op batches one player sends per tick. Zero for a read-only audience.
stall_tolerance: DurationHow long a client may stop reading without losing a frame.
join_burst: usizeConnections that may arrive at once. A server restart reconnects
everybody, which is why this defaults to peak_players.
tick_budget: Option<Duration>What one tick of the application’s own work costs. None reads as the
whole tick period, since a tick that costs more than that cannot keep up.
max_payload: usizeLargest frame this build sends, in bytes.
memory_budget: Option<usize>Bytes this build will spend on outbound queues across every connection.
None sizes from stall_tolerance alone.
priority: PriorityWhether a drop or a wait is the worse failure.
socket_buffer_bytes: usizeWhat the host buffers under the outbound queue. See
DEFAULT_SOCKET_BUFFER_BYTES.
Implementations§
Source§impl Workload
impl Workload
Sourcepub fn horde() -> Self
pub fn horde() -> Self
Many entities in one view: fast, and large enough per frame that memory rather than time is what bounds the queue.
Sourcepub fn turn_based() -> Self
pub fn turn_based() -> Self
Cards, auctions, anything where a lost op is a lost move.
Many long-lived connections carrying light traffic, bounded by what the per-connection queues cost multiplied by the connection count.