Documentation Index
Fetch the complete documentation index at: https://mintlify.com/moqtail/moqtail/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheFetch class represents a MOQT Fetch control message. It allows clients to request a specific range of objects from a track without establishing a long-lived subscription. Fetch supports three modes: standalone, relative (to an existing subscription), and absolute (to an existing subscription).
Class Definition
Properties
Unique identifier for this fetch request.
Priority value (0-255) for this fetch request. Higher priority requests are processed first.
Specifies the order in which groups should be delivered:
GroupOrder.Original(0x0): Original orderGroupOrder.Ascending(0x1): Ascending orderGroupOrder.Descending(0x2): Descending order
Discriminated union defining the fetch type and its associated properties.
Additional protocol parameters for the fetch request.
Fetch Types
StandAlone Fetch
Fetches objects from a track independently of any subscription.Relative Fetch
Fetches objects relative to the current position of an existing subscription.Absolute Fetch
Fetches objects starting at an absolute location relative to an existing subscription.Methods
getType
Returns the control message type identifier.ControlMessageType.Fetch
serialize
Serializes the Fetch message to a frozen byte buffer for transmission.FrozenByteBuffer containing the serialized message
Throws: LengthExceedsMaxError if the payload exceeds 65535 bytes
parsePayload
Deserializes a Fetch message from a byte buffer.Buffer containing the serialized Fetch message payload
Fetch instance
Throws:
NotEnoughBytesErrorif the buffer doesn’t contain enough dataCastingErrorif invalid fetch type or group order values are encounteredErrorif the fetch type is unknown
Usage Examples
Standalone Fetch
Fetch a specific range of objects from a track.Relative Fetch
Fetch objects relative to an existing subscription’s position.Absolute Fetch
Fetch objects from an absolute position, joining an existing subscription.Parse Incoming Fetch
Fetch vs Subscribe
| Feature | Fetch | Subscribe |
|---|---|---|
| Duration | One-time request | Long-lived stream |
| Use Case | Historical data, specific segments | Live streaming, ongoing updates |
| Range | Fixed start and end | Open-ended or filtered |
| Server Resources | Temporary | Persistent |
Use
Fetch for on-demand content retrieval and Subscribe for continuous streaming scenarios.Related Types
- FetchType - Fetch mode enumeration
- FullTrackName - Track identifier
- Location - Group and object position
- GroupOrder - Group delivery order
- KeyValuePair - Protocol parameters
See Also
- Subscribe - Subscribe to tracks for streaming
- TrackStatus - Query track availability