watermill

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

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

EventBus implements modulex.EventBus using Watermill's Channel.

func NewEventBus

func NewEventBus(bufferSize int64, persistent bool, debug bool) *EventBus

NewEventBus creates a configured in-memory Channel PubSub.

func (*EventBus) Close

func (w *EventBus) Close(ctx context.Context) error

Close cancels all active subscriptions, waits for running handlers to exit, and shuts down the underlying Channel.

func (*EventBus) Publish

func (w *EventBus) Publish(ctx context.Context, topic string, payload []byte) error

Publish generates a Watermill-compatible message, propagates context, and sends it.

func (*EventBus) Subscribe

func (w *EventBus) Subscribe(ctx context.Context, topic string, handler modulex.EventHandler) error

Subscribe listens to a topic and handles messages in the background.

Jump to

Keyboard shortcuts

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