Documentation
¶
Index ¶
Constants ¶
View Source
const MaxRecover = 3
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶
type Manager ¶
type Manager struct {
Quit chan bool // Channel to signal that the manager is done
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) ShutdownOn ¶
type UnitManager ¶
The UnitManager interface is used to manage a unit of work. The ShouldStop method returns a channel that will be closed when the unit should stop. The Done method should be called when the unit is done.
type WorkUnit ¶
type WorkUnit interface {
Run(UnitManager)
}
The WorkUnit interface is used to define a unit of work. The Run method will be called in a goroutine.
type WorkUnitManager ¶
type WorkUnitManager struct {
// contains filtered or unexported fields
}
func (*WorkUnitManager) Done ¶
func (w *WorkUnitManager) Done()
func (*WorkUnitManager) Panic ¶
func (w *WorkUnitManager) Panic(val any)
func (*WorkUnitManager) RequestShutdown ¶
func (m *WorkUnitManager) RequestShutdown()
func (*WorkUnitManager) SetRecoverable ¶ added in v1.2.0
func (wu *WorkUnitManager) SetRecoverable()
func (*WorkUnitManager) ShouldStop ¶
func (w *WorkUnitManager) ShouldStop() <-chan bool
Click to show internal directories.
Click to hide internal directories.