redispubsub

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 5 Imported by: 0

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) Publish

func (r *RedisPubSub) Publish(topic string, data []byte) error

func (*RedisPubSub) Subscribe

func (r *RedisPubSub) Subscribe(topic string, handler func([]byte)) (pubsub.Subscription, error)

Jump to

Keyboard shortcuts

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