events

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AsyncJobName = "framework.events.publish"

Variables

This section is empty.

Functions

func DeliverAsync

func DeliverAsync(ctx context.Context, bus *Bus, payload []byte) error

DeliverAsync decodes the async bridge envelope and republishes the event into the local bus.

func PublishAsync

func PublishAsync(ctx context.Context, bus *Bus, jobs core.Jobs, event any) error

func Subscribe

func Subscribe[T any](b *Bus, handler func(ctx context.Context, event T) error)

Types

type AsyncEnvelope

type AsyncEnvelope struct {
	Type  string          `json:"type"`
	Event json.RawMessage `json:"event"`
}

type Bus

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

func NewBus

func NewBus() *Bus

func (*Bus) Publish

func (b *Bus) Publish(ctx context.Context, event any) error

type HandlerFunc

type HandlerFunc func(ctx context.Context, event any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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