queue

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	Name    string
	Queue   *queue.BoundedQueue
	Limit   int
	Workers int
	// contains filtered or unexported fields
}

Queue to hold items

func New

func New(logger *zap.Logger, name string, limit int, consumer func(item interface{}), workers int) *Queue

New returns brandnew queue

func (*Queue) Close

func (q *Queue) Close()

Close the queue

func (*Queue) Produce

func (q *Queue) Produce(item interface{}) bool

Produce adds an item to the queue

func (*Queue) Size

func (q *Queue) Size() int

Size returns current size of the queue

type QueueSpec

type QueueSpec struct {
	Topic          string
	SubscriptionId int64
	Queue          *Queue
}

used to hold queue and subscription details

func (*QueueSpec) Close

func (qs *QueueSpec) Close()

func (*QueueSpec) Produce

func (qs *QueueSpec) Produce(item interface{}) bool

func (*QueueSpec) Size

func (qs *QueueSpec) Size() int

Jump to

Keyboard shortcuts

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