Documentation
¶
Overview ¶
Package redispubsub adapts a Redis client to the pubsub.PubSub interface using PUBLISH / SUBSCRIBE / PSUBSCRIBE.
Wildcard topics (* and >) are translated to Redis glob patterns and use PSUBSCRIBE. Exact topics use SUBSCRIBE.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisPubSub ¶
type RedisPubSub struct {
// contains filtered or unexported fields
}
RedisPubSub wraps a Redis client as a PubSub.
func New ¶
func New(client *redis.Client) *RedisPubSub
New creates a PubSub backed by a Redis client.
func (*RedisPubSub) Close ¶
func (r *RedisPubSub) Close() error
func (*RedisPubSub) Subscribe ¶
func (r *RedisPubSub) Subscribe(topic string, handler func([]byte)) (pubsub.Subscription, error)
Click to show internal directories.
Click to hide internal directories.