Browse Source

En cours de développement

master
losyme 4 months ago
parent
commit
fe0b52472f
  1. 8
      workers/supervisor.go
  2. 4
      workers/workers.go

8
workers/supervisor.go

@ -50,6 +50,10 @@ func (s *supervisor) loop() {
end = true
s.pool.stop()
}
case "0":
if !end {
s.poolSize = 0
}
case "-1":
if !end && s.poolSize > 0 {
s.poolSize--
@ -88,6 +92,10 @@ func (s *supervisor) stopOneWorker() {
s.eventCh <- "-1"
}
func (s *supervisor) stopAllWorkers() {
s.eventCh <- "0"
}
func (s *supervisor) stop() {
s.eventCh <- "stop"

4
workers/workers.go

@ -23,6 +23,10 @@ func (ws *Workers) StopOneWorker() {
ws.supervisor.stopOneWorker()
}
func (ws *Workers) StopAllWorkers() {
ws.supervisor.stopAllWorkers()
}
func (ws *Workers) State() map[string]*Worker {
return ws.state.data()
}

Loading…
Cancel
Save