Documentation
¶
Overview ¶
Package workers contains code to manage workers.
A worker is a goroutine running in the background that performs some activity related to implementing the OpenVPN protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrShutdown = errors.New("worker is shutting down")
ErrShutdown is the error returned by a worker that is shutting down.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates the lifeycles of the workers implementing the OpenVPN protocol. The zero value is invalid; use NewManager.
func (*Manager) OnWorkerDone ¶
OnWorkerDone MUST be called when a worker goroutine terminates.
func (*Manager) ShouldShutdown ¶
ShouldShutdown returns the channel closed when workers should shut down.
func (*Manager) StartShutdown ¶
func (m *Manager) StartShutdown()
StartShutdown initiates the shutdown of all workers.
func (*Manager) StartWorker ¶
func (m *Manager) StartWorker(fx func())
StartWorker starts a worker in a background goroutine.
func (*Manager) WaitWorkersShutdown ¶
func (m *Manager) WaitWorkersShutdown()
WaitWorkersShutdown blocks until all workers have shut down.