Documentation ¶
Index ¶
- type InMemoryBuffer
- func (b *InMemoryBuffer) Ack(_ context.Context, offsets []isb.Offset) []error
- func (b *InMemoryBuffer) Close() error
- func (b *InMemoryBuffer) GetMessages(num int) []*isb.Message
- func (b *InMemoryBuffer) GetName() string
- func (b *InMemoryBuffer) GetPartitionIdx() int32
- func (b *InMemoryBuffer) IsEmpty() bool
- func (b *InMemoryBuffer) IsFull() bool
- func (b *InMemoryBuffer) NoAck(_ context.Context, _ []isb.Offset)
- func (b *InMemoryBuffer) Pending(_ context.Context) (int64, error)
- func (b *InMemoryBuffer) Read(ctx context.Context, count int64) ([]*isb.ReadMessage, error)
- func (b *InMemoryBuffer) String() string
- func (b *InMemoryBuffer) Write(_ context.Context, messages []isb.Message) ([]isb.Offset, []error)
- type Option
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) 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) Read ¶
func (b *InMemoryBuffer) Read(ctx context.Context, count int64) ([]*isb.ReadMessage, 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
WithReadTimeOut is used to set read timeout option
Click to show internal directories.
Click to hide internal directories.