pubsub

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(hub *Hub, args [][]byte) redis.Reply

Publish send msg to all subscribing client

func Subscribe

func Subscribe(hub *Hub, c redis.Connection, args [][]byte) redis.Reply

Subscribe puts the given connection into the given channel

func UnSubscribe

func UnSubscribe(db *Hub, c redis.Connection, args [][]byte) redis.Reply

UnSubscribe removes the given connection from the given channel

func UnsubscribeAll

func UnsubscribeAll(hub *Hub, c redis.Connection)

UnsubscribeAll removes the given connection from all subscribing channel

Types

type Hub

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

Hub stores all subscribe relations

func MakeHub

func MakeHub() *Hub

MakeHub creates new hub

Jump to

Keyboard shortcuts

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