mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-02 01:52:16 +00:00
16 lines
380 B
Go
16 lines
380 B
Go
package consensus
|
|
|
|
import (
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
// NOTE: this is blocking
|
|
func subscribeToEvent(evsw types.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
|
|
// listen for new round
|
|
ch := make(chan interface{}, chanCap)
|
|
types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
|
|
ch <- data
|
|
})
|
|
return ch
|
|
}
|