notifier

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationTopic

type NotificationTopic string
const (
	NotificationTopicInsert     NotificationTopic = "river_insert"
	NotificationTopicLeadership NotificationTopic = "river_leadership"
	NotificationTopicJobControl NotificationTopic = "river_job_control"
)

type Notifier

type Notifier struct {
	baseservice.BaseService
	// contains filtered or unexported fields
}

func New

func New(archetype *baseservice.Archetype, connConfig *pgx.ConnConfig, statusChangeFunc func(componentstatus.Status), logger *slog.Logger) *Notifier

func (*Notifier) Listen

func (n *Notifier) Listen(topic NotificationTopic, notifyFunc NotifyFunc) *Subscription

func (*Notifier) Run

func (n *Notifier) Run(ctx context.Context)

type NotifyFunc

type NotifyFunc func(topic NotificationTopic, payload string)

type Subscription

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

func (*Subscription) Unlisten

func (s *Subscription) Unlisten()

Jump to

Keyboard shortcuts

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