summaryrefslogtreecommitdiff
path: root/events/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'events/interface.go')
-rw-r--r--events/interface.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/events/interface.go b/events/interface.go
new file mode 100644
index 00000000..7d57e4d0
--- /dev/null
+++ b/events/interface.go
@@ -0,0 +1,14 @@
+package events
+
+// Handler interface
+type Handler interface {
+ // NumListeners return number of active listeners
+ NumListeners() int
+ // AddListener adds lister to the publisher
+ AddListener(listener Listener)
+ // Push pushes event to the listeners
+ Push(e interface{})
+}
+
+// Listener .. (type alias) event listener listens for the events produced by worker, worker pool or other service.
+type Listener func(event interface{})