eager

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() iface.Broker

New creates new Broker instance

Types

type Broker

type Broker struct {
	common.Broker
	// contains filtered or unexported fields
}

Broker represents an "eager" in-memory broker

func (*Broker) AssignWorker

func (eagerBroker *Broker) AssignWorker(w iface.TaskProcessor)

AssignWorker assigns a worker to the eager broker

func (*Broker) GetPendingTasks

func (eagerBroker *Broker) GetPendingTasks(queue string) ([]*tasks.Signature, error)

GetPendingTasks returns a slice of task.Signatures waiting in the queue

func (*Broker) Publish

func (eagerBroker *Broker) Publish(task *tasks.Signature) error

Publish places a new message on the default queue

func (*Broker) StartConsuming

func (eagerBroker *Broker) StartConsuming(consumerTag string, concurrency int, p iface.TaskProcessor) (bool, error)

StartConsuming enters a loop and waits for incoming messages

func (*Broker) StopConsuming

func (eagerBroker *Broker) StopConsuming()

StopConsuming quits the loop

type Mode added in v1.7.0

type Mode interface {
	AssignWorker(p iface.TaskProcessor)
}

Mode interface with methods specific for this broker

Jump to

Keyboard shortcuts

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