redis

package
v0.0.0-...-226497a Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package redis implements the various qp transports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direct

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

Direct represents a qp.DirectTransport.

func NewDirect

func NewDirect(url string) *Direct

NewDirect makes a new Direct redis transport.

func NewDirectTimeout

func NewDirectTimeout(url string, connectTimeout, readTimeout, writeTimeout time.Duration) *Direct

NewDirectTimeout makes a new Direct redis transport and allows you to specify timeout values.

func (*Direct) OnMessage

func (d *Direct) OnMessage(channel string, handler qp.Handler) error

OnMessage binds the handler to the specified channel.

func (*Direct) Send

func (d *Direct) Send(channel string, data []byte) error

Send sends data on the channel.

func (*Direct) SetLogger

func (d *Direct) SetLogger(log slog.Logger)

SetLogger sets the Logger to log to.

func (*Direct) Start

func (d *Direct) Start() error

Start starts the transport.

func (*Direct) Stop

func (d *Direct) Stop(grace time.Duration)

Stop instructs the transport to gracefully stop and close the StopChan when stopping has completed.

In-flight requests will have "wait" duration to complete before being abandoned.

func (*Direct) StopChan

func (d *Direct) StopChan() <-chan stop.Signal

StopChan gets the stop channel which will block until stopping has completed, at which point it is closed. Callers should never close the stop channel.

type PubSub

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

PubSub represents a qp.PubSubTransport.

func NewPubSub

func NewPubSub(url string) *PubSub

NewPubSub makes a new PubSub redis transport.

func NewPubSubTimeout

func NewPubSubTimeout(url string, connectTimeout, readTimeout, writeTimeout time.Duration) *PubSub

NewPubSubTimeout makes a new PubSub redis transport and allows you to specify timeout values.

func (*PubSub) Publish

func (p *PubSub) Publish(channel string, data []byte) error

Publish publishes data on the specified channel.

func (*PubSub) SetLogger

func (p *PubSub) SetLogger(log slog.Logger)

SetLogger sets the Logger to log to.

func (*PubSub) Start

func (p *PubSub) Start() error

Start starts the transport.

func (*PubSub) Stop

func (p *PubSub) Stop(grace time.Duration)

Stop stops the transport and closes StopChan() when finished.

func (*PubSub) StopChan

func (p *PubSub) StopChan() <-chan stop.Signal

StopChan gets the stop channel which will be closed when this transport has successfully stopped.

func (*PubSub) Subscribe

func (p *PubSub) Subscribe(channel string, handler qp.Handler) error

Subscribe binds the handler to the specified channel.

Jump to

Keyboard shortcuts

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