|
|
@ -128,16 +128,6 @@ func (evsw *EventSwitch) FireEvent(event string, data EventData) { |
|
|
|
eventCell.FireEvent(data) |
|
|
|
} |
|
|
|
|
|
|
|
func (evsw *EventSwitch) SubscribeToEvent(receiver, eventID string, chanCap int) chan interface{} { |
|
|
|
// listen for new round
|
|
|
|
ch := make(chan interface{}, chanCap) |
|
|
|
evsw.AddListenerForEvent(receiver, eventID, func(data EventData) { |
|
|
|
// NOTE: in production, evsw callbacks should be nonblocking.
|
|
|
|
ch <- data |
|
|
|
}) |
|
|
|
return ch |
|
|
|
} |
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// eventCell handles keeping track of listener callbacks for a given event.
|
|
|
|