summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/worker_handler/handler.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/worker_handler/handler.go b/pkg/worker_handler/handler.go
index 2534a331..fc03563b 100644
--- a/pkg/worker_handler/handler.go
+++ b/pkg/worker_handler/handler.go
@@ -192,8 +192,13 @@ func (h *Handler) handleResponse(req *Request, resp *Response, start time.Time)
// sendEvent invokes event handler if any.
func (h *Handler) sendEvent(event interface{}) {
if h.lsn != nil {
- for _, l := range h.lsn {
- l(event)
+ for i := range h.lsn {
+ // do not block the pipeline
+ // TODO not a good approach, redesign event bus
+ i := i
+ go func() {
+ h.lsn[i](event)
+ }()
}
}
}