pubsub

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	common.Service
	common.Daemon
	common.Initializable
	common.Debuggable
	common.MessageSender
	common.RawMessageSender

	// Publish sends a message to all subscribers of the given topic.
	// The publisher (from) will NOT receive its own message.
	// If payload implements common.Message, MessageHandler subscribers are notified.
	// RawMessageHandler subscribers are always notified.
	Publish(from common.Named, topic string, kind string, payload any)

	// Subscribe registers a service to receive events on the given topic.
	// Topics are hierarchical: subscribing to "app" receives events from
	// "app", "app/module", "app/module/component", etc.
	Subscribe(svc common.Named, topic string)

	// Unsubscribe removes a service's subscription from the given topic.
	Unsubscribe(svc common.Named, topic string)
}

func New

func New(b driver.Driver, opts ...Option) Manager

type Option

type Option func(*manager)

func WithLogger

func WithLogger(logger log.Logger) Option

func WithName

func WithName(name string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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