broker

package
v0.0.0-...-0d53e84 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(scheme string, b Broker)

Register a broker based on its scheme

Types

type Broker

type Broker interface {
	Connect(brokerURL string) error
	GetTasks(queue string) <-chan *Message
	GetTaskResult(taskID string) <-chan *Message
	PublishTask(queueName string, taskID string, msg *Message, ignoreResults bool) error
	PublishTaskResult(taskID string, msg *Message) error
	PublishTaskEvent(taskID string, msg *Message) error
	Close() error
}

Broker implements the underlying broker for the task queue

func NewBroker

func NewBroker(uri string) (Broker, error)

NewBroker create a new broker based on the uri

type Message

type Message struct {
	Timestamp   time.Time
	ContentType string
	Body        []byte
}

Message is the data got from broker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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