notify

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package notify receives readiness hints on a dedicated PostgreSQL session.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable  = errors.New("notification listener unavailable")
	ErrNotInstalled = errors.New("task table is not installed")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Pool    asynqpg.NotificationPool
	Logger  *slog.Logger
	Metrics *asynqpg.Metrics
	// Callbacks must be nonblocking. OnType reports whether the type is registered.
	OnType  func(string) bool
	OnReady func()
}

type Listener

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

Listener owns exactly one connection at a time and never exposes connection errors containing a DSN.

func New

func New(config Config) (*Listener, error)

func (*Listener) Start

func (l *Listener) Start(ctx context.Context) error

func (*Listener) Stop

func (l *Listener) Stop()

type Target

type Target struct {
	Database string `db:"database"`
	Schema   string `db:"schema"`
	Channel  string `db:"-"`
	TableOID uint32 `db:"table_oid"`
}

func ResolveTarget

func ResolveTarget(ctx context.Context, pool asynqpg.Pool) (Target, error)

Jump to

Keyboard shortcuts

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