diff options
author | Valery Piashchynski <[email protected]> | 2020-12-17 03:16:55 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-17 03:16:55 +0300 |
commit | 40cfd9f6b44dfe987bfbf010bf67b32abdc64208 (patch) | |
tree | 10e3c3cd0805619ac30533078eb7d2585877a1b3 /util | |
parent | 9d5fe4f6a98b30fd73be8259f84fa595ac994a71 (diff) |
Now better
Diffstat (limited to 'util')
-rwxr-xr-x | util/events.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/util/events.go b/util/events.go index 8aa5a1c6..259c7ddb 100755 --- a/util/events.go +++ b/util/events.go @@ -1,14 +1,16 @@ package util -import "github.com/spiral/roadrunner/v2/interfaces/worker" +import ( + "github.com/spiral/roadrunner/v2/interfaces/events" +) // EventHandler helps to broadcast events to multiple listeners. type EventHandler struct { - listeners []worker.EventListener + listeners []events.EventListener } -func NewEventsHandler() worker.EventsHandler { - return &EventHandler{listeners: make([]worker.EventListener, 0, 2)} +func NewEventsHandler() events.Handler { + return &EventHandler{listeners: make([]events.EventListener, 0, 2)} } // NumListeners returns number of event listeners. @@ -17,7 +19,7 @@ func (eb *EventHandler) NumListeners() int { } // AddListener registers new event listener. -func (eb *EventHandler) AddListener(listener worker.EventListener) { +func (eb *EventHandler) AddListener(listener events.EventListener) { eb.listeners = append(eb.listeners, listener) } |