blob: ac6c15a4e0c3e271b793cda65477991a87ae32bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package events
// Handler interface
type Handler interface {
// 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{})
}
// Event listener listens for the events produced by worker, worker pool or other service.
type Listener func(event interface{})
|