add lastest offset option
This commit is contained in:
Родитель
c232eab169
Коммит
6ebcd25aa9
10
receiver.go
10
receiver.go
|
@ -55,8 +55,6 @@ func ReceiveWithConsumerGroup(consumerGroup string) ReceiveOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReceiveWithStartingOffset configures the receiver to start at a given position in the event stream
|
// ReceiveWithStartingOffset configures the receiver to start at a given position in the event stream
|
||||||
//
|
|
||||||
// This setting will be overridden by the Hub's OffsetPersister if an offset can be read.
|
|
||||||
func ReceiveWithStartingOffset(offset string) ReceiveOption {
|
func ReceiveWithStartingOffset(offset string) ReceiveOption {
|
||||||
return func(receiver *receiver) error {
|
return func(receiver *receiver) error {
|
||||||
receiver.storeLastReceivedOffset(offset)
|
receiver.storeLastReceivedOffset(offset)
|
||||||
|
@ -64,6 +62,14 @@ func ReceiveWithStartingOffset(offset string) ReceiveOption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReceiveWithLatestOffset configures the receiver to start at a given position in the event stream
|
||||||
|
func ReceiveWithLatestOffset() ReceiveOption {
|
||||||
|
return func(receiver *receiver) error {
|
||||||
|
receiver.storeLastReceivedOffset(EndOfStream)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ReceiveWithPrefetchCount configures the receiver to attempt to fetch as many messages as the prefetch amount
|
// ReceiveWithPrefetchCount configures the receiver to attempt to fetch as many messages as the prefetch amount
|
||||||
func ReceiveWithPrefetchCount(prefetch uint32) ReceiveOption {
|
func ReceiveWithPrefetchCount(prefetch uint32) ReceiveOption {
|
||||||
return func(receiver *receiver) error {
|
return func(receiver *receiver) error {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче