amqp

package
v0.0.0-...-1d26606 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTls               = false // Whether to use TLS connection by default
	DefaultPort              = 5672
	DefaultPriority          = 5 // Default priority of tasks loaded into queue
	DefaultTaskQueue         = "mida-tasks"
	DefaultBroadcastExchange = "mida-broadcast"
	DefaultPostQueue         = "mida-complete"
)

Variables

This section is empty.

Functions

func DecodeAMQPMessageToRawTask

func DecodeAMQPMessageToRawTask(delivery amqp.Delivery) (b.RawTask, error)

Takes an AMQP message (which is expected to be a MIDATask, in JSON format) and converts it into an actual MIDATask struct

func LoadSummaryPost

func LoadSummaryPost(summary b.TaskSummary, params ConnParams, queue string, priority uint8) error

LoadSummaryPost loads task summary data into AMQP queue. Creates and tears down a new connections each time.

func LoadTasks

func LoadTasks(tasks b.TaskSet, params ConnParams, queue string, priority uint8, shuffle bool) (int, error)

LoadTasks handles loading MIDA tasks in to AMQP (probably RabbitMQ) queue.

Types

type ConnParams

type ConnParams struct {
	User string
	Pass string
	Uri  string
}

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

func NewAMQPBroadcastConsumer

func NewAMQPBroadcastConsumer(params ConnParams, queue string) (*Consumer, <-chan amqp.Delivery, error)

NewAMQPControlConsumer connects to a AMQP which will be used for control messages rather than tasks

func NewAMQPTasksConsumer

func NewAMQPTasksConsumer(params ConnParams, queue string) (*Consumer, <-chan amqp.Delivery, error)

func (*Consumer) Shutdown

func (c *Consumer) Shutdown() error

Graceful shutdown of a connection to AMQP

Jump to

Keyboard shortcuts

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