consensus: test reactor

This commit is contained in:
Ethan Buchman
2016-06-26 00:40:53 -04:00
parent fd128c7180
commit f837252ff1
4 changed files with 97 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import (
// NOTE: this is blocking
func subscribeToEvent(evsw types.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
// listen for new round
// listen for event
ch := make(chan interface{}, chanCap)
types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
ch <- data