Documentation
¶
Index ¶
- Constants
- type Fsm
- func (s *Fsm) Compare(state int64) bool
- func (s *Fsm) CurrentState() int64
- func (s *Fsm) IsActive() bool
- func (s *Fsm) LastUsed() uint64
- func (s *Fsm) NumExecs() uint64
- func (s *Fsm) RegisterExec()
- func (s *Fsm) SetLastUsed(lu uint64)
- func (s *Fsm) String() string
- func (s *Fsm) Transition(to int64)
- func (s *Fsm) TransitionFrom(from, to int64) bool
Constants ¶
View Source
const ( // StateInactive - no associated process StateInactive int64 = iota // StateReady - ready for job. StateReady // StateWorking - working on given payload. StateWorking // StateInvalid - indicates that WorkerProcess is being disabled and will be removed. StateInvalid // StateStopping - process is being softly stopped. StateStopping // StateStopped - process has been terminated. StateStopped // StateDestroyed State of worker, when no need to allocate new one StateDestroyed // StateMaxJobsReached State of worker, when it reached executions limit StateMaxJobsReached // StateErrored - worker is in an error state (can't be used). StateErrored // StateIdleTTLReached - worker idle TTL was reached StateIdleTTLReached // StateTTLReached - worker TTL was reached StateTTLReached // StateMaxMemoryReached - worker max memory limit was reached StateMaxMemoryReached // StateExecTTLReached - worker execution TTL was reached StateExecTTLReached )
All worker states
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fsm ¶
type Fsm struct {
// contains filtered or unexported fields
}
Fsm is general https://en.wikipedia.org/wiki/Finite-state_machine to transition between worker states
func (*Fsm) RegisterExec ¶
func (s *Fsm) RegisterExec()
RegisterExec register new execution atomically
func (*Fsm) Transition ¶
Transition moves worker from one state to another
func (*Fsm) TransitionFrom ¶
Click to show internal directories.
Click to hide internal directories.