Documentation ¶
Index ¶
- Constants
- func FetchPID(rl relay.Relay) (int64, error)
- func SendControl(rl relay.Relay, payload interface{}) error
- type State
- type StopCommand
- type WorkerState
- func (s *WorkerState) IsActive() bool
- func (s *WorkerState) LastUsed() uint64
- func (s *WorkerState) NumExecs() uint64
- func (s *WorkerState) RegisterExec()
- func (s *WorkerState) Set(value int64)
- func (s *WorkerState) SetLastUsed(lu uint64)
- func (s *WorkerState) String() string
- func (s *WorkerState) Value() int64
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 StateKilling // State of worker, when no need to allocate new one StateDestroyed // StateStopped - process has been terminated. StateStopped // StateErrored - error WorkerState (can't be used). StateErrored StateRemove )
Variables ¶
This section is empty.
Functions ¶
func SendControl ¶
Types ¶
type State ¶
type State interface { fmt.Stringer // Value returns WorkerState value Value() int64 // Set sets the WorkerState Set(value int64) // NumJobs shows how many times WorkerProcess was invoked NumExecs() uint64 // IsActive returns true if WorkerProcess not Inactive or Stopped IsActive() bool // RegisterExec using to registering php executions RegisterExec() // SetLastUsed sets worker last used time SetLastUsed(lu uint64) // LastUsed return worker last used time LastUsed() uint64 }
State represents WorkerProcess status and updated time.
type StopCommand ¶
type StopCommand struct {
Stop bool `json:"stop"`
}
type WorkerState ¶
type WorkerState struct {
// contains filtered or unexported fields
}
func (*WorkerState) IsActive ¶
func (s *WorkerState) IsActive() bool
IsActive returns true if WorkerProcess not Inactive or Stopped
func (*WorkerState) LastUsed ¶
func (s *WorkerState) LastUsed() uint64
func (*WorkerState) NumExecs ¶
func (s *WorkerState) NumExecs() uint64
NumExecs returns number of registered WorkerProcess execs.
func (*WorkerState) RegisterExec ¶
func (s *WorkerState) RegisterExec()
register new execution atomically
func (*WorkerState) SetLastUsed ¶
func (s *WorkerState) SetLastUsed(lu uint64)
Update last used time
func (*WorkerState) String ¶
func (s *WorkerState) String() string
String returns current WorkerState as string.
func (*WorkerState) Value ¶
func (s *WorkerState) Value() int64
Value WorkerState returns WorkerState value
Click to show internal directories.
Click to hide internal directories.