eager

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MPL-2.0 Imports: 9 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) AddCycleTask added in v0.1.3

func (b *Broker) AddCycleTask(signature *tasks.Signature) (*tasks.Signature, error)

add cycle signature

func (*Broker) AssignWorker

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

AssignWorker assigns a worker to the eager broker

func (*Broker) ConsumeHeartbeat added in v0.1.4

func (b *Broker) ConsumeHeartbeat() (*monitor.Heartbeat, error)

func (*Broker) DeleteCycleTask added in v0.1.3

func (b *Broker) DeleteCycleTask(uuid string) error

func (*Broker) GetCycleTasks added in v0.1.3

func (b *Broker) GetCycleTasks(queue string) ([]*tasks.Signature, error)

get cycle signatures

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(ctx context.Context, task *tasks.Signature) error

Publish places a new message on the default queue

func (*Broker) SendHeartbeat added in v0.1.4

func (b *Broker) SendHeartbeat(ctx context.Context, heartbeat *monitor.Heartbeat) error

add cycle signature

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

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