mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
16 lines
367 B
Go
16 lines
367 B
Go
|
package consensus
|
||
|
|
||
|
import (
|
||
|
"github.com/tendermint/go-events"
|
||
|
)
|
||
|
|
||
|
// NOTE: this is blocking
|
||
|
func subscribeToEvent(evsw *events.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
|
||
|
// listen for new round
|
||
|
ch := make(chan interface{}, chanCap)
|
||
|
evsw.AddListenerForEvent(receiver, eventID, func(data events.EventData) {
|
||
|
ch <- data
|
||
|
})
|
||
|
return ch
|
||
|
}
|