node

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

Consumer provides a container for `Consumer` configuration and run time values

func NewConsumer

func NewConsumer(uri, key string) *Consumer

NewConsumer will, given the URI of a rabbitMQ instance and a key with which to consume from, generate a Consumer for a node to receive messages germane to their operation

type Node

type Node struct {
	Consumer    *Consumer
	Producer    *Producer
	TaskManager taskmanager.TaskManager
}

Node creates a Node. Nodes are the powerhouse of the tool; they receive messages from RabbitMQ (*Consumer), push messages into RabbitMQ (*Producer) and handle what those individual messages are (TaskManager)

func NewNode

func NewNode(uri, redisURI, nodeMode string) (n Node)

NewNode returns a Node container

func (*Node) ConsumerLoop

func (n *Node) ConsumerLoop() (err error)

ConsumerLoop connects to RabbitMQ based on a *Consumer and route messages

type Producer

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

Producer configuration for sending messages via rabbit MQ

func NewProducer

func NewProducer(uri, key string) *Producer

NewProducer creates configuration container *Producer

func (*Producer) Send

func (p *Producer) Send(body []byte) error

Send a payload via rabbit amqp

Jump to

Keyboard shortcuts

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