pub struct Consumer { /* private fields */ }Expand description
Consumes an ordered log of binary payloads from a track, yielding every one.
The log is a single group. That is what makes the mode lossless: rolling to a second group
means the records that would have completed the first are gone, so a publisher that cannot
write ends the track instead. A second group is therefore a broken publisher, and reading it
would present a gap as a continuous log, so it fails with
Error::Rolled rather than yielding the remainder.
The failure does not wait for the first group to end: whatever has already arrived in it is yielded, and the read then fails rather than blocking on a group a broken publisher may never finish.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn new(track: Subscriber, config: Config) -> Self
pub fn new(track: Subscriber, config: Config) -> Self
Create a consumer reading from the given track subscriber.
Set Config::compression to match the producer that wrote the track.