pubsub

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PublishedTotal is the total number of published messages during the life of this instance.
	PublishedTotal = stats.NewInt64Counter()

	// CurrentSubscribers is the current number of listeners of Pub/Sub.
	CurrentSubscribers = stats.NewInt64Gauge()

	// SubscribersTotal is the total number of registered listeners during the life of this instance.
	SubscribersTotal = stats.NewInt64Counter()

	CurrentPSubscribers = stats.NewInt64Gauge()
	PSubscribersTotal   = stats.NewInt64Counter()
)

Functions

func NewService

func NewService(e *environment.Environment) (service.Service, error)

Types

type PubSub

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

PubSub is a Redis compatible pub/sub server

func (*PubSub) Channels

func (ps *PubSub) Channels() []string

func (*PubSub) ChannelsWithPatterns

func (ps *PubSub) ChannelsWithPatterns(pattern string) []string

func (*PubSub) Numpat

func (ps *PubSub) Numpat() int

func (*PubSub) Numsub

func (ps *PubSub) Numsub(channel string) int

func (*PubSub) Psubscribe

func (ps *PubSub) Psubscribe(conn redcon.Conn, channel string)

Psubscribe a connection to PubSub

func (*PubSub) Publish

func (ps *PubSub) Publish(channel, message string) int

Publish a message to subscribers

func (*PubSub) Subscribe

func (ps *PubSub) Subscribe(conn redcon.Conn, channel string)

Subscribe a connection to PubSub

type Service

type Service struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Service) RegisterHandlers

func (s *Service) RegisterHandlers()

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

func (*Service) Start

func (s *Service) Start() error

Jump to

Keyboard shortcuts

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