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.
Click to show internal directories.
Click to hide internal directories.