Skip to content

Allow host-provided QUIC time sources #4459

Description

@thethorne48

Some WASM hosts advance monotonic time and schedule wakeups through host-managed events rather than the browser timer APIs used by Iroh today. In those environments, QUIC deadlines can stall while the isolate is suspended between I/O events.

I would like to add an unstable endpoint-level time source with two operations:

fn now(&self) -> QuicInstant;
fn sleep_until(&self, deadline: QuicInstant)
    -> Pin<Box<dyn Future<Output = ()> + Send>>;

Iroh would adapt these futures internally to noq’s AsyncTimer; resetting a timer would replace and drop the obsolete sleep future. The default runtime would remain unchanged.

Non-goals are replacing task spawning, sockets, tracing, or shutdown, and no host-specific dependency would be added to Iroh. The API would remain behind an unstable feature.

I plan to work on this. Before opening the implementation for review, does this API boundary and placement on endpoint::Builder match the project’s preferred direction?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      🏗 In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions