You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
367 B

  1. package consensus
  2. import (
  3. "github.com/tendermint/go-events"
  4. )
  5. // NOTE: this is blocking
  6. func subscribeToEvent(evsw *events.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
  7. // listen for new round
  8. ch := make(chan interface{}, chanCap)
  9. evsw.AddListenerForEvent(receiver, eventID, func(data events.EventData) {
  10. ch <- data
  11. })
  12. return ch
  13. }