Files
exo/rust
Jake Hillion dfd6fe7816 swarm: replace manual Stream impl with async_stream select loop (#1597)
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
2026-02-23 17:48:55 +00:00
..
2026-02-19 12:55:31 +00:00