1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! A thread-per-core io_uring worker for the native MoQ stack.
//!
//! One [`Worker`] per pinned thread. It owns a `SINGLE_ISSUER | DEFER_TASKRUN |
//! COOP_TASKRUN` ring, a userspace timer heap, a local task set, and the UDP
//! sockets bound through it. The caller owns the thread loop: drive everything
//! with [`Worker::block_on`], spawn extra `!Send` tasks through [`Handle`], and
//! wake the worker from other threads through any [`std::task::Waker`] it hands
//! out (a futex word, no ring or syscall needed while the worker is awake).
//!
//! UDP is the point: [`udp::Socket`] receives through one multishot `recvmsg`
//! with a registered provided-buffer ring (one whole buffer per completion,
//! `UDP_GRO` coalesced) and sends with an explicit `UDP_SEGMENT` control
//! message per `sendmsg` from a growable pool of staging buffers.
//!
//! [`quic`] stacks a sans-IO QUIC stack on that path: a [`quic::Endpoint`]
//! serves many connections on one socket (demuxed by connection id, dials
//! included), each a [`quic::Connection`] implementing the transport traits,
//! so `moq_net::Client::connect_lite` and `Server::accept_lite` run real
//! moq-lite sessions on the worker. The socket is the identity: whatever is
//! built on it runs on the worker that adopted it, and a socket adopted as a
//! member of a steered reuseport group ([`udp::Bound`]) issues connection ids
//! that steer back to it. [`Handle::run`] supplies time and schedules driver
//! wakeups; callers run the returned drivers with [`Handle::spawn`]. The stack
//! underneath is enabled by the `noq` feature; a build without it leaves the
//! module out.
//!
//! [`metrics::Metrics`] is how the worker's own health leaves its thread:
//! relaxed counters for the buffer pools, the batching mechanisms, the ring,
//! and the scheduler, snapshotted from anywhere. Hand one to
//! [`Config::metrics`] to keep a copy where the worker was spawned, or read the
//! worker's own through [`Handle::metrics`].
//!
//! Requires Linux 6.12; [`Worker::new`] refuses older kernels with a legible
//! error instead of degrading. The crate compiles to nothing off Linux.
// Off Linux the crate compiles to nothing, so these doc links have no target.
pub use Error;
pub use Timer;
pub use ;
/// The `url` crate, re-exported because
/// [`quic::web::Request::url`](crate::quic::web::Request::url) hands one back.
/// Naming that type otherwise means depending on a matching `url` version
/// directly, so a major bump here is a breaking change for this crate.
pub use url;