cheesegrinder

package module
v0.0.0-...-a936c54 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2014 License: BSD-3-Clause Imports: 2 Imported by: 0

README

cheesegrinder

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(c redis.Conn, topic string, msg string) error

Publish publishes a single message on the given topic.

Types

type ConnectionFactory

type ConnectionFactory func() redis.Conn

ConnectionFactory is a function which creates a new redis.Conn. Since a connection can't be used once it is in subscription mode, this pattern has been introduced to create a new connection for every subscription and give an opportunity to do authentication.

type Subscription

type Subscription struct {
	Messages <-chan string
	// contains filtered or unexported fields
}

Subscription is a subscription to a topic. All messages will be pushed to the Messages channel. Close the close-cha

func Subscribe

func Subscribe(f ConnectionFactory, topic string) Subscription

Subscribe creates a new subscription to the given topic.

func (*Subscription) Close

func (s *Subscription) Close()

Close unsubscribes from the topic and closes the connection.

Jump to

Keyboard shortcuts

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