workers

package
v0.0.0-...-1a3a2fa Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package workers implements transcript (and possibly other) workers.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoWorkers = errors.New("no workers")
)

Functions

func NewWorkerManager

func NewWorkerManager(met metrics.Metrics, nexus Broadcaster, tgst tgstore.Store, cfg config.Workers) (*workerManager, error)

Types

type Broadcaster

type Broadcaster interface {
	Broadcast(broadcast.Message)
}

type Client

type Client interface {
	Send(broadcast.ToClientMsg) error
}

type Durationer

type Durationer interface {
	GetDuration() time.Duration
}

type Manager

type Manager interface {
	// Dispatch selects a worker to take this message if it passes filtering.
	Dispatch(ctx context.Context, msg broadcast.Message) error

	// DispatchUnfiltered selects a worker to take this message without filtering.
	DispatchUnfiltered(ctx context.Context, msg broadcast.Message) error

	// Register registers a client to the pool.
	Register(ctx context.Context, c Client, cmd *pb.Register) error

	// Unregister unregisters a client from the worker pool.
	Unregister(Client)

	// SetTranscript sets a transcript.
	SetTranscript(ctx context.Context, stx *pb.SetTranscript) error

	// HUP implements Hupper.
	HUP(config.Workers)
}

Jump to

Keyboard shortcuts

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