Documentation ¶
Index ¶
- type AMQPBroker
- func (amqpBroker *AMQPBroker) IsTaskRegistered(name string) bool
- func (amqpBroker *AMQPBroker) Publish(signature *signatures.TaskSignature) error
- func (amqpBroker *AMQPBroker) SetRegisteredTaskNames(names []string)
- func (amqpBroker *AMQPBroker) StartConsuming(consumerTag string, taskProcessor TaskProcessor) (bool, error)
- func (amqpBroker *AMQPBroker) StopConsuming()
- type Broker
- type EagerBroker
- func (e *EagerBroker) AssignWorker(p TaskProcessor)
- func (e *EagerBroker) IsTaskRegistered(name string) bool
- func (e *EagerBroker) Publish(task *signatures.TaskSignature) error
- func (e *EagerBroker) SetRegisteredTaskNames(names []string)
- func (e *EagerBroker) StartConsuming(consumerTag string, p TaskProcessor) (bool, error)
- func (e *EagerBroker) StopConsuming()
- type EagerMode
- type RedisBroker
- func (redisBroker *RedisBroker) IsTaskRegistered(name string) bool
- func (redisBroker *RedisBroker) Publish(signature *signatures.TaskSignature) error
- func (redisBroker *RedisBroker) SetRegisteredTaskNames(names []string)
- func (redisBroker *RedisBroker) StartConsuming(consumerTag string, taskProcessor TaskProcessor) (bool, error)
- func (redisBroker *RedisBroker) StopConsuming()
- type TaskProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPBroker ¶
type AMQPBroker struct {
// contains filtered or unexported fields
}
AMQPBroker represents an AMQP broker
func (*AMQPBroker) IsTaskRegistered ¶
func (amqpBroker *AMQPBroker) IsTaskRegistered(name string) bool
IsTaskRegistered returns true if the task is registered with this broker
func (*AMQPBroker) Publish ¶
func (amqpBroker *AMQPBroker) Publish(signature *signatures.TaskSignature) error
Publish places a new message on the default queue
func (*AMQPBroker) SetRegisteredTaskNames ¶
func (amqpBroker *AMQPBroker) SetRegisteredTaskNames(names []string)
SetRegisteredTaskNames sets registered task names
func (*AMQPBroker) StartConsuming ¶
func (amqpBroker *AMQPBroker) StartConsuming(consumerTag string, taskProcessor TaskProcessor) (bool, error)
StartConsuming enters a loop and waits for incoming messages
func (*AMQPBroker) StopConsuming ¶
func (amqpBroker *AMQPBroker) StopConsuming()
StopConsuming quits the loop
type Broker ¶
type Broker interface { SetRegisteredTaskNames(names []string) IsTaskRegistered(name string) bool StartConsuming(consumerTag string, p TaskProcessor) (bool, error) StopConsuming() Publish(task *signatures.TaskSignature) error }
Broker - a common interface for all brokers
func NewAMQPBroker ¶
NewAMQPBroker creates new AMQPBroker instance
func NewEagerBroker ¶
func NewEagerBroker() Broker
type EagerBroker ¶
type EagerBroker struct {
// contains filtered or unexported fields
}
func (*EagerBroker) AssignWorker ¶
func (e *EagerBroker) AssignWorker(p TaskProcessor)
Eager interface
func (*EagerBroker) IsTaskRegistered ¶
func (e *EagerBroker) IsTaskRegistered(name string) bool
func (*EagerBroker) Publish ¶
func (e *EagerBroker) Publish(task *signatures.TaskSignature) error
func (*EagerBroker) SetRegisteredTaskNames ¶
func (e *EagerBroker) SetRegisteredTaskNames(names []string)
Broker interface
func (*EagerBroker) StartConsuming ¶
func (e *EagerBroker) StartConsuming(consumerTag string, p TaskProcessor) (bool, error)
func (*EagerBroker) StopConsuming ¶
func (e *EagerBroker) StopConsuming()
type EagerMode ¶
type EagerMode interface {
AssignWorker(p TaskProcessor)
}
type RedisBroker ¶
type RedisBroker struct {
// contains filtered or unexported fields
}
RedisBroker represents a Redis broker
func (*RedisBroker) IsTaskRegistered ¶
func (redisBroker *RedisBroker) IsTaskRegistered(name string) bool
IsTaskRegistered returns true if the task is registered with this broker
func (*RedisBroker) Publish ¶
func (redisBroker *RedisBroker) Publish(signature *signatures.TaskSignature) error
Publish places a new message on the default queue
func (*RedisBroker) SetRegisteredTaskNames ¶
func (redisBroker *RedisBroker) SetRegisteredTaskNames(names []string)
SetRegisteredTaskNames sets registered task names
func (*RedisBroker) StartConsuming ¶
func (redisBroker *RedisBroker) StartConsuming(consumerTag string, taskProcessor TaskProcessor) (bool, error)
StartConsuming enters a loop and waits for incoming messages
func (*RedisBroker) StopConsuming ¶
func (redisBroker *RedisBroker) StopConsuming()
StopConsuming quits the loop
type TaskProcessor ¶
type TaskProcessor interface {
Process(signature *signatures.TaskSignature) error
}
TaskProcessor - can process a delivered task This will probably always be a worker instance