redis

package
v0.0.0-...-a780941 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

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

Listener waits for events in a Redis queue and hands them off to processors

func NewListener

func NewListener(client *redis.Client, queueName string) *Listener

NewPublisher returns a new Publisher for the given redis connection and queue name

func (*Listener) Halt

func (l *Listener) Halt()

Halt stops the listen goroutine

func (*Listener) Listen

func (l *Listener) Listen(errFn events.ErrorHandler)

Listen spawns a non-blocking goroutine to listen for new events

func (*Listener) RegisterHandler

func (l *Listener) RegisterHandler(name string, fn events.EventHandler)

RegisterHandler registers an event handler for events of the given string name

type Publisher

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

Publisher pushes events to a Redis circular queue

func NewPublisher

func NewPublisher(client *redis.Client, queueName string) *Publisher

NewPublisher returns a new Publisher for the given redis connection and queue name

func (*Publisher) Publish

func (p *Publisher) Publish(event *events.Event) error

Publish pushes out the given event to a Redis circular queue

Jump to

Keyboard shortcuts

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