Documentation ¶
Index ¶
- func SparseAcks2Str(offset offsetmgr.Offset) string
- type T
- func (ot *T) Adjust(offset int64) (offsetmgr.Offset, int)
- func (ot *T) IsAcked(offset int64) (bool, int64)
- func (ot *T) NextRetry() (consumer.Message, int, bool)
- func (ot *T) OnAcked(offset int64) (offsetmgr.Offset, int)
- func (ot *T) OnOffered(msg consumer.Message) int
- func (ot *T) ShouldWait4Ack() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SparseAcks2Str ¶
SparseAcks2Str returns human readable representation of sparsely committed ranges encoded in the specified offset metadata.
Types ¶
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents an entity that tracks offered and acknowledged messages and maintains offset data for the current state.
func (*T) Adjust ¶
Adjust adjusts the tracked offset. Offers with offsets lower then the new offset value are dropped.
func (*T) IsAcked ¶
IsAcked checks if an offset has already been acknowledged. The second returned value is the smallest not acked offset that is greater than the specified offset.
func (*T) NextRetry ¶
NextRetry returns a next message to be retried along with the retry attempt number. If there are no messages to be retried then nil is returned.
func (*T) OnAcked ¶
OnAcked should be called when a message has been acknowledged by a consumer. It returns an offset to be submitted and a total number of offered messages.
func (*T) OnOffered ¶
OnOffered should be called when a message has been offered to a consumer. It returns the total number of offered messages. It is callers responsibility to ensure that the number of offered message does not grow too large.
func (*T) ShouldWait4Ack ¶
ShouldWait4Ack tells how much time until all offers expire.