Skip to main content
Fetch is a mechanism for requesting a specific group from a track without maintaining a continuous subscription. It is primarily used to retrieve groups that were dropped by the publisher (e.g., cancelled via DropGroups or DropNextGroups) but may still be available in relay or cache nodes. This allows subscribers to recover recently dropped data and maintain playback continuity.

Fetch a Group

To fetch a specific group, use the Session.Fetch method with a moqt.FetchRequest:

moqt.FetchRequest

Context and Cancellation

The FetchRequest supports context-based cancellation. When the context is cancelled, the fetch stream is automatically cancelled:

Handle Fetch Requests (Server Side)

To serve fetch requests, implement the FetchHandler interface and configure it on the server or dialer:
The handler receives a GroupWriter to write frames and a FetchRequest describing what the client is requesting.

Using FetchHandlerFunc

For simple handlers, use the convenience type FetchHandlerFunc:

Configuring FetchHandler

On a Server (native QUIC):
On a Dialer (WebTransport):
On a WebTransportHandler:

Error Handling

Fetch operations may return moqt.FetchError or moqt.SessionError. Use type assertions for specific handling:
See Built-in Error Codes for FetchErrorCode values.