queue

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BenanstalkProtocol            = "beanstalk"
	UnsyncedQueueMessageCount     = -1
	UnsyncedMessagesSentPerMinute = -1
	UnsyncedIdleWorkers           = -1
)
View Source
const (
	SqsQueueService       = "sqs"
	BeanstalkQueueService = "beanstalkd"
)

Variables

This section is empty.

Functions

func DeepCopyItem added in v0.1.2

func DeepCopyItem(original map[string]QueueSpec) map[string]QueueSpec

func DeepCopyThread added in v0.1.3

func DeepCopyThread(original map[string]bool) map[string]bool

Types

type Beanstalk added in v1.0.0

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

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

func (*Beanstalk) GetName added in v1.0.0

func (b *Beanstalk) GetName() string

type BeanstalkClientInterface added in v1.0.0

type BeanstalkClientInterface interface {
	// contains filtered or unexported methods
}

func NewBeanstalkClient added in v1.0.0

func NewBeanstalkClient(queueURI string) (BeanstalkClientInterface, error)

type MockBeanstalkClientInterface added in v1.0.0

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

MockBeanstalkClientInterface is a mock of BeanstalkClientInterface interface

func NewMockBeanstalkClientInterface added in v1.0.0

func NewMockBeanstalkClientInterface(ctrl *gomock.Controller) *MockBeanstalkClientInterface

NewMockBeanstalkClientInterface creates a new mock instance

func (*MockBeanstalkClientInterface) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use

type MockBeanstalkClientInterfaceMockRecorder added in v1.0.0

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

MockBeanstalkClientInterfaceMockRecorder is the mock recorder for MockBeanstalkClientInterface

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, queueService QueuingService) *Poller

func (*Poller) Run

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

func (*Poller) Sync added in v1.0.0

func (p *Poller) Sync(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, secondsToProcessOneJob float64) 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, float64, int32)

func (*Queues) List

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

func (*Queues) ListAll added in v1.0.0

func (q *Queues) ListAll() 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 {
	// GetName returns the name of the queing service
	GetName() string
	// contains filtered or unexported methods
}

func NewBeanstalk added in v1.0.0

func NewBeanstalk(
	name string,
	queues *Queues,
	shortPollInterval int,
	longPollInterval int) (QueuingService, error)

func NewSQS

func NewSQS(
	name string,
	awsRegions []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) GetName added in v1.0.0

func (s *SQS) GetName() string

Jump to

Keyboard shortcuts

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