queue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueProviderSQS          = "sqs"
	QueueProviderBeanstalk    = "beanstalk"
	BenanstalkProtocol        = "beanstalk"
	UnsyncedQueueMessageCount = -1
	UnsyncedIdleWorkers       = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Poller

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

Poller is the generic poller which manages polling of queues from the configured message queuing service provider

func NewPoller

func NewPoller(queues *Queues, service QueuingService) Poller

func (*Poller) Run

func (p *Poller) Run(stopCh <-chan struct{})

type QueueSpec

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

QueueSpec is the specification for a single queue

type Queues

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

Queues maintains a list of all queues as specified in WPAs in memory The list is kept in sync with the wpa objects

func NewQueues

func NewQueues() *Queues

func (*Queues) Add

func (q *Queues) Add(namespace string, name string, uri string, workers int32) error

func (*Queues) Delete

func (q *Queues) Delete(namespace string, name string) error

func (*Queues) GetQueueInfo

func (q *Queues) GetQueueInfo(namespace string, name string) (string, int32, int32)

func (*Queues) List

func (q *Queues) List() map[string]*QueueSpec

func (*Queues) ListQueue

func (q *Queues) ListQueue(key string) *QueueSpec

func (*Queues) Sync

func (q *Queues) Sync(stopCh <-chan struct{})

type QueuingService

type QueuingService interface {
	Sync(stopCh <-chan struct{})
	// contains filtered or unexported methods
}

QueuingService is the interface for the message queueing service For example: SQS and Beanstalk implements QueuingService interface

func NewSQS

func NewSQS(
	awsRegion string,
	queues *Queues,
	shortPollInterval int,
	longPollInterval int) (QueuingService, error)

type SQS

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

SQS is used to by the Poller to get the queue information from AWS SQS, it implements the QueuingService interface

func (*SQS) Sync

func (s *SQS) Sync(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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