notifications

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package notifications relays PostgreSQL wakeup hints. Durable state remains in PostgreSQL; subscribers must subscribe before checking it and recheck after Wait.

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("notification relay closed")

Functions

This section is empty.

Types

type Relay

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

Relay owns one direct session, independent of request pool capacity.

func New

func New(ctx context.Context, pool *pgxpool.Pool, logger *zap.Logger) *Relay

New starts the relay. Its owner must call Shutdown before closing the database.

func (*Relay) Shutdown

func (r *Relay) Shutdown(ctx context.Context) error

func (*Relay) Subscribe

func (r *Relay) Subscribe(topic Topic, id uuid.UUID) *Subscription

type Subscription

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

func (*Subscription) Close

func (s *Subscription) Close()

Close releases this subscription; it is safe to call more than once.

func (*Subscription) Wait

func (s *Subscription) Wait(ctx context.Context) error

Wait returns on a keyed hint or periodic reconciliation, cancellation, or relay shutdown. Hints coalesce, so every successful return requires a DB read.

type Topic

type Topic string
const (
	HostWork        Topic = "airlock_host_work"
	ConnectorEvents Topic = "airlock_connector_events"
)

Jump to

Keyboard shortcuts

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