redis

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cnf *config.Config, host, password, socketPath string, db int) iface.Broker

New creates new Broker instance

func NewGR

func NewGR(cnf *config.Config, addrs []string, db int) iface.Broker

New creates new Broker instance

Types

type Broker

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

Broker represents a Redis broker

func (*Broker) AddCycleTask added in v0.1.3

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

get cycle signatures

func (*Broker) ConsumeHeartbeat added in v0.1.4

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

StartConsuming enters a loop and waits for incoming messages

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 (b *Broker) GetPendingTasks(queue string) ([]*tasks.Signature, error)

GetPendingTasks returns a slice of task signatures waiting in the queue

func (*Broker) Publish

func (b *Broker) Publish(ctx context.Context, signature *tasks.Signature) error

Publish places a new message on the default queue

func (*Broker) SendHeartbeat added in v0.1.4

func (b *Broker) SendHeartbeat(heartbeat *monitor.Heartbeat, queue string) error

StartConsuming enters a loop and waits for incoming messages

func (*Broker) StartConsuming

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

StartConsuming enters a loop and waits for incoming messages

func (*Broker) StopConsuming

func (b *Broker) StopConsuming()

StopConsuming quits the loop

type BrokerGR

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

Broker represents a Redis broker

func (*BrokerGR) AddCycleTask added in v0.1.3

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

add cycle signature

func (*BrokerGR) ConsumeHeartbeat added in v0.1.4

func (b *BrokerGR) ConsumeHeartbeat(queue string) (*monitor.Heartbeat, error)

func (*BrokerGR) DeleteCycleTask added in v0.1.3

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

func (*BrokerGR) GetCycleTasks added in v0.1.3

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

get cycle signatures

func (*BrokerGR) GetPendingTasks

func (b *BrokerGR) GetPendingTasks(queue string) ([]*tasks.Signature, error)

GetPendingTasks returns a slice of task signatures waiting in the queue

func (*BrokerGR) Publish

func (b *BrokerGR) Publish(ctx context.Context, signature *tasks.Signature) error

Publish places a new message on the default queue

func (*BrokerGR) SendHeartbeat added in v0.1.4

func (b *BrokerGR) SendHeartbeat(heartbeat *monitor.Heartbeat, queue string) error

add cycle signature

func (*BrokerGR) StartConsuming

func (b *BrokerGR) StartConsuming(consumerTag string, concurrency int, taskProcessor iface.TaskProcessor) (bool, error)

StartConsuming enters a loop and waits for incoming messages

func (*BrokerGR) StopConsuming

func (b *BrokerGR) StopConsuming()

StopConsuming quits the loop

Jump to

Keyboard shortcuts

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