topiclistenerinternal

package
v3.76.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserCloseTopic = errors.New("ydb: user closed topic listener")

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	// OnStartPartitionSessionRequest called when server send start partition session request method.
	// You can use it to store read progress on your own side.
	// You must call event.Confirm(...) for start to receive messages from the partition.
	// You can set topiclistener.StartPartitionSessionConfirm for change default settings.
	//
	// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
	OnStartPartitionSessionRequest(ctx context.Context, event *PublicStartPartitionSessionEvent) error

	// OnReadMessages called with batch of messages. Max count of messages limited by internal buffer size
	//
	// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
	OnReadMessages(ctx context.Context, event *PublicReadMessages) error

	// OnStopPartitionSessionRequest called when the server send stop partition message.
	// It means that no more OnReadMessages calls for the partition session.
	// You must call event.Confirm() for allow the server to stop the partition session (if event.Graceful=true).
	// Confirm is optional for event.Graceful=false
	// The method can be called twice: with event.Graceful=true, then event.Graceful=false.
	// It is guaranteed about the method will be called least once.
	//
	// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
	OnStopPartitionSessionRequest(ctx context.Context, event *PublicStopPartitionSessionEvent) error
}

type PublicOffsetsRange

type PublicOffsetsRange struct {
	Start int64
	End   int64
}

PublicOffsetsRange

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

type PublicReadMessages

type PublicReadMessages struct {
	PartitionSession topicreadercommon.PublicPartitionSession
	Batch            *topicreader.Batch
}

PublicReadMessages

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

type PublicStartPartitionSessionConfirm

type PublicStartPartitionSessionConfirm struct {
	CommitOffset *int64 ``
	// contains filtered or unexported fields
}

PublicStartPartitionSessionConfirm

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

type PublicStartPartitionSessionEvent

type PublicStartPartitionSessionEvent struct {
	PartitionSession topicreadercommon.PublicPartitionSession
	CommittedOffset  int64
	PartitionOffsets PublicOffsetsRange
	// contains filtered or unexported fields
}

PublicStartPartitionSessionEvent

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

func (*PublicStartPartitionSessionEvent) Confirm

func (e *PublicStartPartitionSessionEvent) Confirm()

Confirm

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

func (*PublicStartPartitionSessionEvent) ConfirmWithParams

type PublicStopPartitionSessionConfirm

type PublicStopPartitionSessionConfirm struct{}

PublicStopPartitionSessionConfirm

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

type PublicStopPartitionSessionEvent

type PublicStopPartitionSessionEvent struct {
	PartitionSession topicreadercommon.PublicPartitionSession

	// Graceful mean about server is waiting for client finish work with the partition and confirm stop the work
	// if the field is false it mean about server stop lease the partition to the client and can assignee the partition
	// to other read session (on this or other connection).
	Graceful        bool
	CommittedOffset int64
	// contains filtered or unexported fields
}

PublicStopPartitionSessionEvent

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

func (*PublicStopPartitionSessionEvent) Confirm

func (e *PublicStopPartitionSessionEvent) Confirm()

Confirm

Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental

type StreamListenerConfig

type StreamListenerConfig struct {
	BufferSize             int
	Decoders               topicreadercommon.DecoderMap
	Selectors              []*topicreadercommon.PublicReadSelector
	Consumer               string
	ConnectWithoutConsumer bool
	// contains filtered or unexported fields
}

func NewStreamListenerConfig

func NewStreamListenerConfig() StreamListenerConfig

func (*StreamListenerConfig) Validate

func (cfg *StreamListenerConfig) Validate() error

type TopicClient

type TopicClient interface {
	StreamRead(connectionCtx context.Context) (rawtopicreader.StreamReader, error)
}

type TopicListenerReconnector

type TopicListenerReconnector struct {
	// contains filtered or unexported fields
}

func NewTopicListenerReconnector

func NewTopicListenerReconnector(
	client TopicClient,
	streamConfig *StreamListenerConfig,
	handler EventHandler,
) (*TopicListenerReconnector, error)

func (*TopicListenerReconnector) Close

func (lr *TopicListenerReconnector) Close(ctx context.Context, reason error) error

func (*TopicListenerReconnector) WaitInit

func (lr *TopicListenerReconnector) WaitInit(ctx context.Context) error

func (*TopicListenerReconnector) WaitStop

func (lr *TopicListenerReconnector) WaitStop(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL