messagebus

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPingInterval = 30 * time.Second
	DefaultPingTimeout  = 10 * time.Second
)

Default ping settings used by AttachWebSocket when WithPing is not provided. Setting WithPing(0, ...) disables server-side pings.

View Source
const DefaultTopic = "/messages"

DefaultTopic is the topic messagebus uses when WithTopic is not provided.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// business
	model.MessageBus
	// lifecycle
	common.Daemon
	common.Debuggable
}

func New

func New(bus model.Pubsub, opts ...Option) Manager

type Option

type Option func(*manager)

func WithLogger

func WithLogger(logger log.Logger) Option

func WithName

func WithName(name string) Option

func WithPing added in v0.4.8

func WithPing(interval, timeout time.Duration) Option

WithPing configures server-side WebSocket pings emitted by AttachWebSocket. interval controls how often pings are sent (0 disables pings); timeout is the maximum time to wait for a pong before tearing the connection down.

func WithTopic

func WithTopic(topic string) Option

WithTopic overrides the default bus topic ("/messages"). Use this when you need multiple messagebus instances sharing one pubsub.

Jump to

Keyboard shortcuts

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