notifier

package
v0.0.2-0...-34c92f2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSubscription

type CreateSubscription func(ctx context.Context, id string) Subscription

type Listener

type Listener interface {
	// ID is the listener ID for a given topic
	ID() string

	Listen() <-chan any
}

type Metric

type Metric interface {
	GetMetric() any
}

type Subscription

type Subscription interface {
	// Subscription is also a listener
	Listener

	// Start receiving message
	Start()

	// Publish to this single subscription
	// intended to be called by state machine / app or for debugging purpose
	Publish(message any) error
}

It can be a "FSM" that lives on each request

type Topic

type Topic interface {
	// TODO: find new pattern, maybe CreateSubscription can be leftout?
	Subscribe(ctx context.Context, fn CreateSubscription) (Subscription, error)
	GetSubscription(id string) (Subscription, error)
	RemoveSubscription(id string) error
	Broadcast(ctx context.Context, message any) error
}

Topic implementation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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