func (s *StateImpl) SetLastUsed(lu uint64) {
	atomic.StoreUint64(&s.lastUsed, lu)
}
SetLastUsed Update last used time
package worker
import (
	"sync/atomic"
)
const (
	StateInactive int64 = iota
	StateReady
	StateWorking
	StateInvalid
	StateStopping
	StateKilling
	StateDestroyed
	StateMaxJobsReached
	StateStopped
	StateErrored
)
type StateImpl struct {
	value    int64
	numExecs uint64
	lastUsed uint64
}
func NewWorkerState(value int64) *StateImpl {
	return &StateImpl{value: value}
}
func (s *StateImpl) String() string {
	switch s.Value() {
	case StateInactive:
		return "inactive"
	case StateReady:
		return "ready"
	case StateWorking:
		return "working"
	case StateInvalid:
		return "invalid"
	case StateStopping:
		return "stopping"
	case StateStopped:
		return "stopped"
	case StateKilling:
		return "killing"
	case StateErrored:
		return "errored"
	case StateDestroyed:
		return "destroyed"
	}
	return "undefined"
}
func (s *StateImpl) NumExecs() uint64 {
	return atomic.LoadUint64(&s.numExecs)
}
func (s *StateImpl) Value() int64 {
	return atomic.LoadInt64(&s.value)
}
func (s *StateImpl) IsActive() bool {
	val := s.Value()
	return val == StateWorking || val == StateReady
}
func (s *StateImpl) Set(value int64) {
	atomic.StoreInt64(&s.value, value)
}
func (s *StateImpl) RegisterExec() {
	atomic.AddUint64(&s.numExecs, 1)
}