You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gateway: concurrent pulls from one long-lived worker #2458
decdn gateway (#2456) runs one pull at a time, and every content request repeats the whole fetch_into bring-up. Serve concurrent requests from one long-lived pull worker instead.
Today
One global pull slot. The pull thread holds it until the response body is drained, and waiting for it has no timeout. A <video> whose browser stops reading (preload done, background tab) fills the 1 MiB pipe and holds the slot until the 120 s no-progress give-up. Every other image, entry and manifest request waits behind it.
Each request starts a new OS thread and current-thread runtime, reloads the config, resolves relays and discovery, opens the redb buyer store, builds a new iroh endpoint and installs a Ctrl-C watcher. A bundle page with 30 images makes 30 serialized bring-ups before bytes flow.
Design
One worker thread with a LocalSet (the fetch future is not Send) that holds one Endpoint, one buyer store and one Connections across pulls, and runs each request as a local task. Pulls under one capability share its lanes through the engine's LaneLedgers seam, so concurrent pulls never double-spend a lane. HTTP handlers send a request to the worker and stream from its pipe as today.
Open question: whether the shared-ledger multi-pull surface stays a gateway-internal use of the hidden seams or becomes public decdn-client SDK API.
Acceptance
Two content requests stream at once; a stalled response does not block another.
The endpoint and store are built once per gateway run.
Concurrent pulls under one capability pay correct cumulative vouchers per lane.
Activity
feat(cli): decdn gateway runs pulls at once on one long-lived worker (#…