summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-23 13:15:33 +0300
committerWolfy-J <[email protected]>2018-06-23 13:15:33 +0300
commit38d694411abbdb0c31b08b96452fa0604a93418a (patch)
tree828492153bd4893347534e6ee9858bbb4d45f233 /static_pool.go
parent14a54572d7a3754aeb81d3dc9949276b7fff04fe (diff)
support for realtime error aggegration
Diffstat (limited to 'static_pool.go')
-rw-r--r--static_pool.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/static_pool.go b/static_pool.go
index b3e4f488..79166197 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -83,6 +83,12 @@ func (p *StaticPool) Listen(l func(event int, ctx interface{})) {
defer p.mul.Unlock()
p.lsn = l
+
+ p.muw.RLock()
+ for _, w := range p.workers {
+ w.err.Listen(l)
+ }
+ p.muw.RUnlock()
}
// Config returns associated pool configuration. Immutable.
@@ -207,6 +213,12 @@ func (p *StaticPool) createWorker() (*Worker, error) {
return nil, err
}
+ p.mul.Lock()
+ if p.lsn != nil {
+ w.err.Listen(p.lsn)
+ }
+ defer p.mul.Unlock()
+
p.throw(EventWorkerConstruct, w)
p.muw.Lock()