Example #1
0
// StartMonitorFeed starts a goroutine which processes events published to the
// supplied Subscription. The goroutine will continue running until the
// Subscription's Events feed is closed.
func (nsm *NodeStatusMonitor) StartMonitorFeed(feed *util.Feed) {
	sub := feed.Subscribe()
	go func() {
		for event := range sub.Events() {
			if syncEvent, ok := event.(*TestSyncEvent); ok {
				syncEvent.consume()
			}

			ProcessNodeEvent(nsm, event)
			storage.ProcessStoreEvent(nsm, event)
		}
	}()
}
Example #2
0
// StartMonitorFeed starts a goroutine which processes events published to the
// supplied Subscription. The goroutine will continue running until the
// Subscription's Events feed is closed.
func (nsm *NodeStatusMonitor) StartMonitorFeed(feed *util.Feed) {
	go storage.ProcessStoreEvents(nsm, feed.Subscribe())
	go ProcessNodeEvents(nsm, feed.Subscribe())
}
Example #3
0
func (ner *nodeEventReader) readEvents(feed *util.Feed) {
	ner.perNodeFeeds = make(map[roachpb.NodeID][]string)
	feed.Subscribe(ner.recordEvent)
}
Example #4
0
func (ser *storeEventReader) readEvents(feed *util.Feed) {
	ser.perStoreFeeds = make(map[roachpb.StoreID][]string)
	ser.perStoreUpdateCount = make(map[roachpb.StoreID]map[roachpb.Method]int)
	feed.Subscribe(ser.recordEvent)
}
Example #5
0
// StartMonitorFeed starts a goroutine which processes events published to the
// supplied Subscription. The goroutine will continue running until the
// Subscription's Events feed is closed.
func (nsm *NodeStatusMonitor) StartMonitorFeed(feed *util.Feed) {
	feed.Subscribe(func(event interface{}) {
		ProcessNodeEvent(nsm, event)
		storage.ProcessStoreEvent(nsm, event)
	})
}
Example #6
0
func newSimpleEventConsumer(feed *util.Feed) *simpleEventConsumer {
	return &simpleEventConsumer{
		sub: feed.Subscribe(),
	}
}
Example #7
0
func newConsumer(feed *util.Feed) *storeEventConsumer {
	return &storeEventConsumer{
		sub: feed.Subscribe(),
	}
}