redis

package
v0.0.0-...-bb3010e Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package redis implements an asgi channel layer that works with redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRedisPool

func CreateRedisPool(host string)

CreateRedisPool sets the redis pool to connect to the host.

Types

type ChannelLayer

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

ChannelLayer is the main type to use as redis channel layer.

func NewChannelLayer

func NewChannelLayer(expiry int, host string, prefix string, capacity int) *ChannelLayer

NewChannelLayer creates a new RedisChannelLayer

func (*ChannelLayer) NewChannel

func (r *ChannelLayer) NewChannel(channelPrefix string) (channel string, err error)

NewChannel creates a new channelname

func (*ChannelLayer) Receive

func (r *ChannelLayer) Receive(
	channels []string,
	block bool) (channel string, message asgi.Message, err error)

Receive reads from a channel and returns a raw message objekt

func (*ChannelLayer) Send

func (r *ChannelLayer) Send(channel string, message asgi.Message) (err error)

Send sends a message to a specific channel

Jump to

Keyboard shortcuts

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