blob: 7d57e4d02bc5ea771c96d7150a0f64deb52d69d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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{})
|