simplebuffer

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryBuffer

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

InMemoryBuffer implements ISB interface.

func NewInMemoryBuffer

func NewInMemoryBuffer(name string, size int64, partition int32, opts ...Option) *InMemoryBuffer

NewInMemoryBuffer returns a new buffer.

func (*InMemoryBuffer) Ack

func (b *InMemoryBuffer) Ack(_ context.Context, offsets []isb.Offset) []error

Ack acknowledges the given offsets

func (*InMemoryBuffer) Close

func (b *InMemoryBuffer) Close() error

Close does nothing.

func (*InMemoryBuffer) GetMessages added in v0.7.3

func (b *InMemoryBuffer) GetMessages(num int) []*isb.Message

GetMessages gets the first num messages in the in mem buffer this function is for testing purpose

func (*InMemoryBuffer) GetName

func (b *InMemoryBuffer) GetName() string

GetName returns the buffer name.

func (*InMemoryBuffer) GetPartitionIdx added in v0.9.0

func (b *InMemoryBuffer) GetPartitionIdx() int32

GetPartitionIdx returns the partitionIdx.

func (*InMemoryBuffer) IsEmpty

func (b *InMemoryBuffer) IsEmpty() bool

IsEmpty returns whether the queue is empty.

func (*InMemoryBuffer) IsFull

func (b *InMemoryBuffer) IsFull() bool

IsFull returns whether the queue is full.

func (*InMemoryBuffer) NoAck added in v0.7.3

func (b *InMemoryBuffer) NoAck(_ context.Context, _ []isb.Offset)

func (*InMemoryBuffer) Pending

func (b *InMemoryBuffer) Pending(_ context.Context) (int64, error)

func (*InMemoryBuffer) Read

func (b *InMemoryBuffer) Read(ctx context.Context, count int64) ([]*isb.ReadMessage, error)

func (*InMemoryBuffer) String

func (b *InMemoryBuffer) String() string

Stringer

func (*InMemoryBuffer) Write

func (b *InMemoryBuffer) Write(_ context.Context, messages []isb.Message) ([]isb.Offset, []error)

type Option added in v0.6.5

type Option func(options *options) error

func WithBufferFullWritingStrategy added in v0.7.3

func WithBufferFullWritingStrategy(s dfv1.BufferFullWritingStrategy) Option

WithBufferFullWritingStrategy sets the writing strategy when buffer is full

func WithReadTimeOut added in v0.6.5

func WithReadTimeOut(timeout time.Duration) Option

WithReadTimeOut is used to set read timeout option

Jump to

Keyboard shortcuts

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