struct
Crabbit::OffsetSpecification
- Crabbit::OffsetSpecification
- Struct
- Value
- Object
Overview
Describes where a consumer starts reading a stream.
.first, .last, and .next are relative positions. .offset addresses an
exact stream offset, while .timestamp asks the broker for the first chunk
at or after a point in time.
Defined in:
crabbit/types.crConstructors
-
.first : self
Starts at the first available message in the stream.
-
.last : self
Starts at the beginning of the last committed chunk.
-
.next : self
Starts after the current end of the stream and receives new messages.
-
.none : self
Requests no initial delivery.
-
.offset(value : Int) : self
Starts at the exact non-negative stream value.
-
.timestamp(value : Time) : self
Starts at the first chunk whose timestamp is at or after value.
-
.timestamp(milliseconds : Int) : self
Starts at the first chunk at or after the Unix timestamp milliseconds.
Instance Method Summary
-
#type : OffsetType
Returns the requested offset mode.
-
#value : Int64 | UInt64 | Nil
Returns the numeric offset or Unix timestamp in milliseconds, when the selected mode requires one.
Constructor Detail
Requests no initial delivery.
This is primarily useful as the inactive result of a Single Active Consumer update callback.
Starts at the first chunk whose timestamp is at or after value.
Starts at the first chunk at or after the Unix timestamp milliseconds.
Instance Method Detail
Returns the numeric offset or Unix timestamp in milliseconds, when the selected mode requires one.