worker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Subscriptions []string
}

Filter selects which subscriptions to activate. An empty Subscriptions activates all.

type Registrar

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

Registrar collects named subscriptions and activates a selected subset at startup. It implements contract/worker.Registry: a service's interface layer Adds its subscriptions during wiring, and the worker composition calls Activate with the --subscriptions filter.

func NewRegistrar

func NewRegistrar() *Registrar

NewRegistrar returns an empty Registrar.

func (*Registrar) Activate

func (r *Registrar) Activate(filter Filter) error

Activate applies the selected subscriptions onto their routers. An empty selection activates every subscription; an unknown name is a fatal misconfiguration so a typo fails fast instead of silently subscribing to nothing.

func (*Registrar) Add

func (r *Registrar) Add(name string, apply func())

Add registers a named subscription; apply runs its route registrations when the subscription activates.

Jump to

Keyboard shortcuts

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