Files
lanspread/crates/lanspread-peer/src/services.rs
T
ddidderr 8f35a197a9 refactor(peer): extract peer startup task spawning
The peer runtime used to spawn each long-running service inline inside
run_peer. That made the startup path harder to scan because service names,
clone setup, and task error handling were interleaved with the command loop.

Move the task wrappers into a startup module and leave run_peer as the
lifecycle overview: create shared context, start services, handle commands,
then send shutdown goodbyes. The spawned services and their error handling are
unchanged; only the ownership plumbing moved into named helpers.

Test Plan:
- cargo clippy
- cargo clippy --benches
- cargo clippy --tests
- cargo +nightly fmt

Refs: none
2026-05-02 16:02:37 +02:00

20 lines
480 B
Rust

//! Long-running peer services.
//!
//! Each submodule owns one runtime concern. The public surface intentionally
//! stays small because peer startup only needs to start these four background
//! tasks.
mod advertise;
mod discovery;
mod handshake;
mod legacy;
mod liveness;
mod local_monitor;
mod server;
mod stream;
pub use discovery::run_peer_discovery;
pub use liveness::run_ping_service;
pub use local_monitor::run_local_game_monitor;
pub use server::run_server_component;