summaryrefslogtreecommitdiff
path: root/interfaces/events/handler.go
diff options
context:
space:
mode:
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{})