Documentation
¶
Index ¶
Constants ¶
View Source
const ( StateFile = "factory_state.json" TargetGoal = 100 )
Variables ¶
This section is empty.
Functions ¶
func RunFactory ¶
func RunFactory(sup lifecycle.Supervisor, store *Store, suspendHandler *lifecycle.SuspendHandler)
RunFactory executes the standard interactive factory logic for suspend examples.
Types ¶
type Blocker ¶
type Blocker struct {
*lifecycle.BaseWorker
}
Blocker is a worker that refuses to suspend quickly, testing the USER's patience.
func NewBlocker ¶
func NewBlocker() *Blocker
type FactoryState ¶
type FactoryState struct {
ItemsProduced int `json:"items_produced"`
ItemsProcessed int `json:"items_processed"`
}
FactoryState represents the persisted state of our factory.
type Store ¶
type Store struct {
Mu sync.Mutex
State FactoryState
Path string
}
Store manages persistence of factory state.
type Watchdog ¶
type Watchdog struct {
*lifecycle.BaseWorker
}
Watchdog is a system service that runs continuously, ignoring suspension.
func NewWatchdog ¶
func NewWatchdog() *Watchdog
Click to show internal directories.
Click to hide internal directories.