Browse Source

En cours de développement

master
losyme 5 months ago
parent
commit
a7b6f845a9
  1. 2
      go.mod
  2. 4
      go.sum
  3. 5
      workers/pool.go

2
go.mod

@ -11,7 +11,7 @@ require (
forge.chapril.org/losyme/roundrobin v0.0.0-20220101202922-42e4b1e1d136
forge.chapril.org/losyme/util v0.0.0-20220101202923-23640bbd8739
forge.chapril.org/losyme/uuid v0.0.0-20220101202925-b6817a6cc0bb
forge.chapril.org/losyme/zombie v0.0.0-20220119190813-8f49c1ebc818
forge.chapril.org/losyme/zombie v0.0.0-20220119195122-364ddc07ad70
)
require (

4
go.sum

@ -18,5 +18,5 @@ forge.chapril.org/losyme/util v0.0.0-20220101202923-23640bbd8739 h1:02ofB/g/A1UT
forge.chapril.org/losyme/util v0.0.0-20220101202923-23640bbd8739/go.mod h1:lKYvkuBOTU3E2HuQZDh4ZSA4u3VcFopQbdPUKaHGHEk=
forge.chapril.org/losyme/uuid v0.0.0-20220101202925-b6817a6cc0bb h1:Zn6GNf8b2uJ/w8ubBNCCfysKO5lgKGQCPMr56C9KqHk=
forge.chapril.org/losyme/uuid v0.0.0-20220101202925-b6817a6cc0bb/go.mod h1:AgvbvGzTkQkbiM+s9eVhvLUSHbA0V6N+q5oBFI2v0LA=
forge.chapril.org/losyme/zombie v0.0.0-20220119190813-8f49c1ebc818 h1:rdwhhgDWocmcRgvO2syb2OdsspkCTEiIcGkvTDoFlNo=
forge.chapril.org/losyme/zombie v0.0.0-20220119190813-8f49c1ebc818/go.mod h1:f2dCQZ+o+tk8hzWDapLPvqjiEF1QShkS19jOptvoYaM=
forge.chapril.org/losyme/zombie v0.0.0-20220119195122-364ddc07ad70 h1:fujhG4Kgg2vUedvrOLOA7f7s8tfXPkQL0Avp0MWKmZU=
forge.chapril.org/losyme/zombie v0.0.0-20220119195122-364ddc07ad70/go.mod h1:f2dCQZ+o+tk8hzWDapLPvqjiEF1QShkS19jOptvoYaM=

5
workers/pool.go

@ -40,6 +40,7 @@ func (p *pool) size() int {
func (p *pool) startOneWorker(stoppedCh chan<- string) {
worker := newWorker(p.host, p.runner, p.logger, p.state)
fn := func(ctx context.Context) { worker.run(ctx, p.stopCh, stoppedCh) }
p.workers[worker.id] = worker
@ -47,12 +48,12 @@ func (p *pool) startOneWorker(stoppedCh chan<- string) {
p.zombie = zombie.GoWithContext(
context.Background(),
1,
func(ctx context.Context) { worker.run(ctx, p.stopCh, stoppedCh) },
fn,
zombie.WithName("worker"),
zombie.WithLogger(p.logger),
)
} else {
p.zombie.Go(1)
p.zombie.Go(1, fn)
}
}

Loading…
Cancel
Save