Expand description
A group is a stream of frames, split into a Producer and Consumer handle.
A Producer writes an ordered stream of frames. Frames can be written all at once (Producer::write_frame), or in chunks (Producer::create_frame).
A Consumer reads an ordered stream of frames. The reader can be cloned, in which case each reader receives a copy of each frame. (fanout)
Frames are numbered from 0 in write order. A group can be short at its front or its
back but never in the middle: Producer::start_at starts it later, so a handle can
carry the tail of a group whose leading frames came from somewhere else, and
Producer::finish ends it wherever writing stopped. Consumer::with_range bounds a reader to a sub-range the same way track::Subscriber
bounds group keys.
A group has no size cap. Each copy holds at most its newest 32 MiB, less
under the cache pool’s memory pressure, and sheds whole frames from its front to stay
there. A reader that reaches a shed frame rides a flight when the track has a
track::Requests handler: a separate copy from that frame, paced by its fastest
reader, which it leaves for the copy ahead once that holds its frame within reach.
Otherwise reading a shed frame is Error::Evicted.
The stream is closed with Error when all writers or readers are dropped.
Structs§
- Consumer
- Consume a group, frame-by-frame.
- Demand
- A cloneable, watch-only handle to a group’s readers.
- Fetch
- Options for a one-shot
track::Consumer::fetch_groupof a past group. - Finished
- A group whose writer finished it: every frame is written, and it can still be read or aborted, but not written to.
- Info
- A group’s identity: where it starts, in its track’s timescale.
- Producer
- Writes frames to a group in order.