queue

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

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

Go to latest
Published: Dec 17, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package queue implements a Pub/Sub channel in tsuru. It abstracts which server is being used and handles connection pooling and data transmiting

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Queue

func Queue() (monsterqueue.Queue, error)

func ResetQueue

func ResetQueue()

Types

type PubSubFactory

type PubSubFactory interface {
	// PubSub returns a PubSubQ instance, identified by the given name.
	PubSub(name string) (PubSubQ, error)

	Reset()
}

PubSubFactory manages queues. It's able to create new queue and handler instances.

func Factory

func Factory() (PubSubFactory, error)

Factory returns an instance of the PubSubFactory used in tsuru. Only redis pubsub is available.

type PubSubQ

type PubSubQ interface {
	// Publishes a message using the underlaying queue server.
	Pub(msg []byte) error

	// Returns a channel that will yield every message published to this
	// queue.
	Sub() (chan []byte, error)

	// Unsubscribe the queue, this should make sure the channel returned
	// by Sub() is closed.
	UnSub() error
}

PubSubQ represents an implementation that allows Publishing and Subscribing messages.

Jump to

Keyboard shortcuts

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