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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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