summaryrefslogtreecommitdiff
path: root/interfaces/events/handler.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-26 13:13:59 +0300
committerValery Piashchynski <[email protected]>2020-12-26 13:13:59 +0300
commit1aaf6e6ffb015cd5a21d9d938ad84c18723973c5 (patch)
tree7221427ba25f8f99a10720778a420703dc2bff92 /interfaces/events/handler.go
parentde4d0b6e66ceda08b0daec18a218c1baa71ebf04 (diff)
Reorganize eventsv2.0.0-beta4
Diffstat (limited to 'interfaces/events/handler.go')
-rw-r--r--interfaces/events/handler.go8
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{})