struct Crabbit::OffsetSpecification

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.first : self #

Starts at the first available message in the stream.


[View source]
def self.last : self #

Starts at the beginning of the last committed chunk.


[View source]
def self.next : self #

Starts after the current end of the stream and receives new messages.


[View source]
def self.none : self #

Requests no initial delivery.

This is primarily useful as the inactive result of a Single Active Consumer update callback.


[View source]
def self.offset(value : Int) : self #

Starts at the exact non-negative stream value.


[View source]
def self.timestamp(value : Time) : self #

Starts at the first chunk whose timestamp is at or after value.


[View source]
def self.timestamp(milliseconds : Int) : self #

Starts at the first chunk at or after the Unix timestamp milliseconds.


[View source]

Instance Method Detail

def type : OffsetType #

Returns the requested offset mode.


[View source]
def value : Int64 | UInt64 | Nil #

Returns the numeric offset or Unix timestamp in milliseconds, when the selected mode requires one.


[View source]