Documentation ¶
Index ¶
- func New() iface.Broker
- type Broker
- func (b *Broker) AddCycleTask(signature *tasks.Signature) (*tasks.Signature, error)
- func (eagerBroker *Broker) AssignWorker(w iface.TaskProcessor)
- func (b *Broker) ConsumeHeartbeat() (*monitor.Heartbeat, error)
- func (b *Broker) DeleteCycleTask(uuid string) error
- func (b *Broker) GetCycleTasks(queue string) ([]*tasks.Signature, error)
- func (eagerBroker *Broker) GetPendingTasks(queue string) ([]*tasks.Signature, error)
- func (eagerBroker *Broker) Publish(ctx context.Context, task *tasks.Signature) error
- func (b *Broker) SendHeartbeat(ctx context.Context, heartbeat *monitor.Heartbeat) error
- func (eagerBroker *Broker) StartConsuming(consumerTag string, concurrency int, p iface.TaskProcessor) (bool, error)
- func (eagerBroker *Broker) StopConsuming()
- type Mode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broker ¶
Broker represents an "eager" in-memory broker
func (*Broker) AddCycleTask ¶ added in v0.1.3
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 (*Broker) DeleteCycleTask ¶ added in v0.1.3
func (*Broker) GetCycleTasks ¶ added in v0.1.3
get cycle signatures
func (*Broker) GetPendingTasks ¶
GetPendingTasks returns a slice of task.Signatures waiting in the queue
func (*Broker) SendHeartbeat ¶ added in v0.1.4
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
Click to show internal directories.
Click to hide internal directories.