inmemory

package
v0.41.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the queue client used for dev and test purpose.

func New

func New(queue *InmemQueue) *Client

New creates the in-memory queue Client instance. Client will use the default global queue if queue is nil.

func NewNamedQueue

func NewNamedQueue(name string) *Client

New creates the named in-memory queue Client instance.

func (*Client) Dequeue

func (c *Client) Dequeue(ctx context.Context, opts client.QueueClientConfig) (*client.Message, error)

Dequeue dequeues message from the in-memory queue.

func (*Client) Enqueue

func (c *Client) Enqueue(ctx context.Context, msg *client.Message, options ...client.EnqueueOptions) error

Enqueue enqueues message to the in-memory queue.

func (*Client) ExtendMessage

func (c *Client) ExtendMessage(ctx context.Context, msg *client.Message) error

ExtendMessage extends the message lock.

func (*Client) FinishMessage

func (c *Client) FinishMessage(ctx context.Context, msg *client.Message) error

FinishMessage finishes or deletes the message in the queue.

type InmemQueue

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

InmemQueue implements in-memory queue for dev/test

func NewInMemQueue

func NewInMemQueue(lockDuration time.Duration) *InmemQueue

func (*InmemQueue) Complete

func (q *InmemQueue) Complete(msg *client.Message) error

func (*InmemQueue) DeleteAll

func (q *InmemQueue) DeleteAll()

func (*InmemQueue) Dequeue

func (q *InmemQueue) Dequeue() *client.Message

func (*InmemQueue) Enqueue

func (q *InmemQueue) Enqueue(msg *client.Message)

func (*InmemQueue) Extend

func (q *InmemQueue) Extend(msg *client.Message) error

func (*InmemQueue) Len

func (q *InmemQueue) Len() int

Jump to

Keyboard shortcuts

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