Skip to main content

Module runtime

Module runtime 

Source
Expand description

Shared async runtime for all QUIC handles in this process.

Quinn is fully async; the confium_net::Transport / confium_net::Listener traits are blocking. Rather than impose an async runtime on every Confium caller, all QUIC transport/listener handles share a single process-wide tokio runtime and drive their async work via block_on.

A single shared runtime avoids the subtle stalls that arise when two endpoints on two separate runtimes exchange UDP packets while each runtime is parked inside its own block_on: with separate runtimes, neither endpoint’s driver task runs unless its own block_on is on the stack, so a peer’s packet can sit unprocessed in a kernel buffer until the owning thread happens to re-enter block_on. With one runtime, the multi-thread scheduler keeps every endpoint’s driver task making progress regardless of which handle is currently in block_on.