pubsub

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

func (*Hub) Acquire

func (h *Hub) Acquire() *blobcache.Message

func (*Hub) Lookup

func (h *Hub) Lookup(hash [32]byte) blobcache.TID

Lookup attempts to reverse hash. The zero value is returned an unknown topic

func (*Hub) Publish

func (h *Hub) Publish(tmsg *blobcache.Message) int

Publish will return the number of destinations the topic was sent to tmsg should have been obtained using Acquire. After Publish is called, the caller does not need to call Release on the message.

func (*Hub) Release

func (h *Hub) Release(x *blobcache.Message)

func (*Hub) Subscribe

func (h *Hub) Subscribe(tid blobcache.TID, ch chan<- *blobcache.Message) error

Subscribe subscribes to a topic. Future calls to Publish will result in a message being sent on this channel.

func (*Hub) Unsubscribe

func (h *Hub) Unsubscribe(tid blobcache.TID, ch chan<- *blobcache.Message) bool

Unsubscribe ensures that the channel is not subscribed to the topic. If it is effectful then true is returned. If nothing has to be done, then false is returned.

Jump to

Keyboard shortcuts

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