mirror of
https://github.com/exo-explore/exo.git
synced 2026-02-24 02:07:17 -05:00
The Swarm's manual `impl Stream` had a fairness issue: it drained all client commands before polling the inner libp2p swarm, which could theoretically starve network event delivery under heavy command load. Replaced the hand-rolled `poll_next` with `tokio::select!` inside an `async_stream::stream!` generator. This gives fair, randomized polling between the client command channel and the inner swarm. Extracted `on_message` and `filter_swarm_event` as free functions, removed `pin_project` dependency, and changed callers to use `.into_stream()`. Test plan: - CI