supervisor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Supervisor

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

Supervisor manages the lifecycle of multiple workers.

func NewSupervisor

func NewSupervisor() *Supervisor

NewSupervisor creates a new Supervisor instance.

func (*Supervisor) AddWorker

func (s *Supervisor) AddWorker(w worker.Worker)

AddWorker adds a worker to the supervisor.

func (*Supervisor) Start

func (s *Supervisor) Start(ctx context.Context) error

Start launches all registered workers in separate goroutines.

func (*Supervisor) Status

func (s *Supervisor) Status() map[string]string

Status returns a map of worker names and their current status. For now, it just returns whether they are registered.

func (*Supervisor) Stop

func (s *Supervisor) Stop() error

Stop gracefully shuts down all workers and waits for them to finish.

func (*Supervisor) Wait

func (s *Supervisor) Wait()

Wait blocks until all workers have finished.

Jump to

Keyboard shortcuts

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