This commit is contained in:
David Justice 2018-02-20 12:39:28 -08:00
Родитель c232eab169
Коммит 6ebcd25aa9
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -55,8 +55,6 @@ func ReceiveWithConsumerGroup(consumerGroup string) ReceiveOption {
}
// 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 {
return func(receiver *receiver) error {
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
func ReceiveWithPrefetchCount(prefetch uint32) ReceiveOption {
return func(receiver *receiver) error {