sync/src/legacymodule.js

29 lines
588 B
JavaScript
Raw Normal View History

2016-02-04 21:43:20 -08:00
import NullClusterClient from './io/cluster/nullclusterclient';
2016-02-09 23:04:07 -08:00
import Config from './config';
import IOConfiguration from './configuration/ioconfig';
2017-08-15 18:23:03 -07:00
import { EventEmitter } from 'events';
2016-02-04 21:43:20 -08:00
class LegacyModule {
2016-02-09 23:04:07 -08:00
getIOConfig() {
if (!this.ioConfig) {
this.ioConfig = IOConfiguration.fromOldConfig(Config);
}
return this.ioConfig;
}
2016-02-04 21:43:20 -08:00
getClusterClient() {
2016-02-09 23:04:07 -08:00
return new NullClusterClient(this.getIOConfig());
2016-02-04 21:43:20 -08:00
}
2017-08-15 18:23:03 -07:00
getGlobalMessageBus() {
return new EventEmitter();
}
2016-02-04 21:43:20 -08:00
onReady() {
2016-02-09 23:04:07 -08:00
2016-02-04 21:43:20 -08:00
}
}
export { LegacyModule };