// Start function either routes the incoming request from Encoder to next
// Shuffler or to the Analyzer, if the dispatch criteria is met. If the
// dispatch criteria is not met, the incoming Observation is buffered locally
// for the next dispatch attempt.
Start function either routes the incoming request from Encoder to next
Shuffler or to the Analyzer, if the dispatch criteria is met. If the
dispatch criteria is not met, the incoming Observation is buffered locally
for the next dispatch attempt.
// Start function either routes the incoming request from Encoder to next // Shuffler or to the Analyzer if the dispatch criteria is met . If the // dispatch criteria is not met the incoming Observation is buffered locally // for the next dispatch attempt .
func Start(config *shuffler.ShufflerConfig, store storage.Store, batchSize int, analyzerTransport AnalyzerTransport) {
	if store == nil {
		glog.Fatal("Invalid data store handle, exiting.")
	}
	if config == nil {
		glog.Fatal("Invalid server config, exiting.")
	}
	if analyzerTransport == nil {
		glog.Fatal("Invalid Analyzer client.")
	}
	if batchSize <= 0 {
		glog.Fatal("Invalid batch size.")
	}
	if dispatcherSingleton != nil {
		glog.Fatal("Start() must not be invoked twice, exiting.")
	}
	dispatcherSingleton := &Dispatcher{
		store:             store,
		config:            config,
		batchSize:         batchSize,
		analyzerTransport: analyzerTransport,
		lastDispatchTime:  time.Time{},
	}
	dispatcherSingleton.Run()
}
func Start ( config * shuffler . ShufflerConfig , store storage . Store , batchSize int , analyzerTransport AnalyzerTransport ) { if store == nil { glog . Fatal ( " " ) } if config == nil { glog . Fatal ( " " ) } if analyzerTransport == nil { glog . Fatal ( " " ) } if batchSize <= 0 { glog . Fatal ( " " ) } if dispatcherSingleton != nil { glog . Fatal ( " " ) } dispatcherSingleton := & Dispatcher { store : store , config : config , batchSize : batchSize , analyzerTransport : analyzerTransport , lastDispatchTime : time . Time { } , } dispatcherSingleton . Run ( ) }
Start function either routes the incoming request from Encoder to next
Shuffler or to the Analyzer, if the dispatch criteria is met.
Start function either routes the incoming request from Encoder to next Shuffler or to the Analyzer if the dispatch criteria is met .
// invoke dispatcher