mqueue_rpc_client

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqueueStore

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

MqueueStore implements a message queue store backed by a MqueueStore service.

func NewMqueueStore

func NewMqueueStore(client mqueue_rpc.SRPCMqueueStoreClient) *MqueueStore

NewMqueueStore constructs a new MqueueStore.

func (*MqueueStore) DelMqueue

func (s *MqueueStore) DelMqueue(ctx context.Context, id []byte) error

DelMqueue deletes a message queue and all contents by ID.

If not found, should not return an error.

func (*MqueueStore) ListMessageQueues

func (s *MqueueStore) ListMessageQueues(ctx context.Context, prefix []byte, filled bool) ([][]byte, error)

ListMessageQueues lists message queues with a given ID prefix.

Note: if !filled, implementation might not return queues that are empty. If filled is set, implementation must only return filled queues.

func (*MqueueStore) OpenMqueue

func (s *MqueueStore) OpenMqueue(ctx context.Context, id []byte) (mqueue.Queue, error)

OpenMqueue opens a message queue by ID. The context is used for the API calls.

type Queue

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

Queue implements Queue with a QueueOps service.

func NewQueue

func NewQueue(client mqueue_rpc.SRPCQueueOpsClient) *Queue

NewQueue constructs a new TxQueue.

func (*Queue) Ack

func (q *Queue) Ack(ctx context.Context, id uint64) error

Ack acknowledges the head message by ID, if the head message matches the given match ID.

func (*Queue) DeleteQueue

func (q *Queue) DeleteQueue(ctx context.Context) error

DeleteQueue deletes all messages and metadata from the queue.

func (*Queue) Peek

func (q *Queue) Peek(ctx context.Context) (mqueue.Message, bool, error)

Peek returns the next message, if any.

func (*Queue) Push

func (q *Queue) Push(ctx context.Context, data []byte) (mqueue.Message, error)

Push pushes a message to the queue. Note: The data buffer may be reused for GetData() in the message.

func (*Queue) Wait

func (q *Queue) Wait(ctx context.Context, ack bool) (mqueue.Message, error)

Wait() waits for the next message, or context cancellation.

Returns the message. Equiv to Peek if a message is available. Acks the message immediately if ack is true.

Jump to

Keyboard shortcuts

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