diff options
author | Valery Piashchynski <[email protected]> | 2020-12-26 13:13:59 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-26 13:13:59 +0300 |
commit | 1aaf6e6ffb015cd5a21d9d938ad84c18723973c5 (patch) | |
tree | 7221427ba25f8f99a10720778a420703dc2bff92 /interfaces/events/handler.go | |
parent | de4d0b6e66ceda08b0daec18a218c1baa71ebf04 (diff) |
Reorganize eventsv2.0.0-beta4
Diffstat (limited to 'interfaces/events/handler.go')
-rw-r--r-- | interfaces/events/handler.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/interfaces/events/handler.go b/interfaces/events/handler.go index 01f64d73..ac6c15a4 100644 --- a/interfaces/events/handler.go +++ b/interfaces/events/handler.go @@ -1,10 +1,14 @@ package events +// Handler interface type Handler interface { + // Return number of active listeners NumListeners() int - AddListener(listener EventListener) + // AddListener adds lister to the publisher + AddListener(listener Listener) + // Push pushes event to the listeners Push(e interface{}) } // Event listener listens for the events produced by worker, worker pool or other service. -type EventListener func(event interface{}) +type Listener func(event interface{}) |