func (worker *ClientData) Signal(newstate WorkerState) {
	if worker.state == Running {
		worker.state = newstate
		return
	}
	if worker.state == Quiet && newstate == Terminate {
		worker.state = newstate
		return
	}
	if worker.state == Terminate {
		return
	}
}
/*
Send "quiet" or "terminate" to the given client
worker process.  Other signals are undefined.
package server
import (
	"encoding/json"
	"sync"
	"time"
	"github.com/contribsys/faktory/util"
)
type ClientData struct {
	Hostname     string   `json:"hostname"`
	Wid          string   `json:"wid"`
	Pid          int      `json:"pid"`
	Labels       []string `json:"labels"`
	PasswordHash string   `json:"pwdhash"`
	Version      uint8    `json:"v"`
	StartedAt    time.Time
	lastHeartbeat time.Time
	state         WorkerState
}
type WorkerState int
const (
	Running WorkerState = iota
	Quiet
	Terminate
)
func stateString(state WorkerState) string {
	switch state {
	case Quiet:
		return "quiet"
	case Terminate:
		return "terminate"
	default:
		return ""
	}
}
func clientDataFromHello(data string) (*ClientData, error) {
	var client ClientData
	err := json.Unmarshal([]byte(data), &client)
	if err != nil {
		return nil, err
	}
	return &client, nil
}
func (worker *ClientData) IsQuiet() bool {
	return worker.state != Running
}