Documentation ¶
Index ¶
- type BaseHandler
- func (b BaseHandler) OnReadMessages(ctx context.Context, event *ReadMessages) error
- func (b BaseHandler) OnReaderCreated(event *ReaderReady) error
- func (b BaseHandler) OnStartPartitionSessionRequest(ctx context.Context, event *EventStartPartitionSession) error
- func (b BaseHandler) OnStopPartitionSessionRequest(ctx context.Context, event *EventStopPartitionSession) error
- type EventHandler
- type EventStartPartitionSession
- type EventStopPartitionSession
- type OffsetsRange
- type PartitionSession
- type ReadMessages
- type ReaderReady
- type StartPartitionSessionConfirm
- type TopicListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler struct{}
BaseHandler implements default behavior for EventHandler interface you must embed the structure to your own implementation of the interface.
It allows to extend the interface in the future without broke compatibility ¶
Temporary restrictions: all method should be work fast, because is it call from main read loop message and block handle messages loop
Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
func (BaseHandler) OnReadMessages ¶
func (b BaseHandler) OnReadMessages( ctx context.Context, event *ReadMessages, ) error
func (BaseHandler) OnReaderCreated ¶
func (b BaseHandler) OnReaderCreated(event *ReaderReady) error
func (BaseHandler) OnStartPartitionSessionRequest ¶
func (b BaseHandler) OnStartPartitionSessionRequest( ctx context.Context, event *EventStartPartitionSession, ) error
func (BaseHandler) OnStopPartitionSessionRequest ¶
func (b BaseHandler) OnStopPartitionSessionRequest( ctx context.Context, event *EventStopPartitionSession, ) error
OnStopPartitionSessionRequest called when server want to stop send messages for the partition the method may be called more than once for partition session: with graceful shutdown and without no guarantee to call with graceful=false after graceful true it called with partition context if partition exists and with cancelled background context if not
type EventHandler ¶
type EventHandler interface { topiclistenerinternal.EventHandler // OnReaderCreated called once at the reader complete internal initialization // It not mean that reader is connected to a server. // Allow easy initialize your handler with the reader without sync with return of topic.Client StartListener method // Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental OnReaderCreated(event *ReaderReady) error // contains filtered or unexported methods }
EventHandler methods will be called sequentially by partition, but can be called in parallel for different partitions. You should include topiclistener.BaseHandler into your struct for the interface implementation It allows to extend the interface in the future without broke compatibility.
Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
type EventStartPartitionSession ¶ added in v3.76.2
type EventStartPartitionSession = topiclistenerinternal.PublicEventStartPartitionSession
type EventStopPartitionSession ¶ added in v3.76.2
type EventStopPartitionSession = topiclistenerinternal.PublicEventStopPartitionSession
type OffsetsRange ¶
type OffsetsRange = topiclistenerinternal.PublicOffsetsRange
type PartitionSession ¶
type PartitionSession = topicreadercommon.PublicPartitionSession
type ReadMessages ¶
type ReadMessages = topiclistenerinternal.PublicReadMessages
type ReaderReady ¶
type ReaderReady struct {
Listener *TopicListener
}
type StartPartitionSessionConfirm ¶
type StartPartitionSessionConfirm = topiclistenerinternal.PublicStartPartitionSessionConfirm
type TopicListener ¶
type TopicListener struct {
// contains filtered or unexported fields
}
func NewTopicListener ¶
func NewTopicListener( client *rawtopic.Client, config *topiclistenerinternal.StreamListenerConfig, handler EventHandler, ) (*TopicListener, error)