Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskBroker ¶
type TaskBroker struct { ConnectionName string // contains filtered or unexported fields }
TaskBroker represents an instance of message broker used in the A01 system
func CreateInClusterTaskBroker ¶
func CreateInClusterTaskBroker() *TaskBroker
CreateInClusterTaskBroker returns a in-cluster task broker instance
func CreateLocalTaskBroker ¶
func CreateLocalTaskBroker() *TaskBroker
CreateLocalTaskBroker returns a TaskBroker instance used in local testing. The instance expects a message broker running at local 5672 port.
func (*TaskBroker) GetChannel ¶
func (broker *TaskBroker) GetChannel() (*amqp.Channel, error)
GetChannel returns the channel to this task broker. If a channel hasn't been established, a new channel as well as a connection will be created.
func (*TaskBroker) PublishTasks ¶
func (broker *TaskBroker) PublishTasks(queueName string, settings []models.TaskSetting) (err error)
PublishTasks publishes the tasks to the queue specified by the given name. The queue will be declared if it doesn't already exist.
func (*TaskBroker) QueueDeclare ¶
QueueDeclare declare a queue associated with the given name. It returns the queue as well as the channel associate with this connection. If a channel has not been established, a new one will be created.