enum TopicStart
Where a new subscription starts. A group that already has a cursor continues from it and ignores from.
Example:
data Job { id: i64 }
topic Jobs: Job
cluster demo {
role store { journal }
}
fn main() -> () | TopicError io, db {
Jobs.publish(Job{ id: 1 })?
Jobs.publish(Job{ id: 2 })?
for await j in Jobs.subscribe(from: .Offset(1)) {
print("first seen: {j.id}")
break
}
}Output
first seen: 2
@derive(Copy)
pub(api) enum TopicStartSince. 1.0.0-beta
Variants
Latest | Only elements published after the subscription started (the default of a broadcast subscriber). |
Earliest | The oldest retained element (the default of a group). |
Offset(n: i64) | The element at this offset of each partition (the offset of a one-partition topic is exact). |
Since(t: Time) | The first element stored at or after this time. |
Defined in: std/core/topic.oxl:88