watermill

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package watermill provides a Modulex EventBus adapter backed by Watermill's in-memory GoChannel PubSub.

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 GoChannel.

func NewEventBus

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

NewEventBus creates a configured in-memory GoChannel PubSub.

Unlike the nats and rabbitmq adapters, the EventBus owns the underlying GoChannel PubSub it creates: Close shuts it down. There is no separate connection for the caller to manage.

func (*EventBus) Close

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

Close gracefully stops the underlying GoChannel.

func (*EventBus) Publish

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

Publish generates a Watermill-compatible message, propagates context/spans, 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, maintaining span continuity.

Jump to

Keyboard shortcuts

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