iface

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	GetConfig() *config.Config
	SetRegisteredTaskNames(names []string)
	IsTaskRegistered(name string) bool
	StartConsuming(consumerTag string, concurrency int, p TaskProcessor) (bool, error)
	StopConsuming()
	SendHeartbeat(ctx context.Context, heartbeat *monitor.Heartbeat) error
	ConsumeHeartbeat() (*monitor.Heartbeat, error)

	Publish(ctx context.Context, task *tasks.Signature) error
	GetPendingTasks(queue string) ([]*tasks.Signature, error)
	AdjustRoutingKey(s *tasks.Signature)
	// cycle signatures monitor
	GetCycleTasks(queue string) ([]*tasks.Signature, error)
	AddCycleTask(signature *tasks.Signature) (*tasks.Signature, error)
	DeleteCycleTask(uuid string) error
}

Broker - a common interface for all brokers

type TaskProcessor

type TaskProcessor interface {
	Process(signature *tasks.Signature) error
	CustomQueue() string
}

TaskProcessor - can process a delivered task This will probably always be a worker instance

Jump to

Keyboard shortcuts

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