Web Sockets Implemented with one example of system events working
This commit is contained in:
1 parent
0dfe957db7
commit
10c631b5b4
3 files changed
+6
-6
No files matched your search
+1
-1
@@ -986,7 +986,7 @@
|
||||
bot.hasTheBotJustStarted = false;
|
||||
|
||||
/* Emit event that signals that this process finished */
|
||||
global.eventHandler.raiseEvent('Jason-Multi-Period', 'Status Report Updated', { lastProcessedDay: lastFileDate })
|
||||
global.systemEventHandler.raiseEvent('Jason-Multi-Period', 'Status Report Updated', { lastProcessedDay: lastFileDate })
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
@@ -26,19 +26,19 @@ global.CUSTOM_FAIL_RESPONSE = {
|
||||
};
|
||||
|
||||
const EVENT_HANDLER_MODULE = require('./EventHandler.js');
|
||||
global.eventHandler = EVENT_HANDLER_MODULE.newEventHandler()
|
||||
global.systemEventHandler = EVENT_HANDLER_MODULE.newSystemEventHandler()
|
||||
|
||||
global.eventHandler.initialize(bootLoader)
|
||||
global.systemEventHandler.initialize(bootLoader)
|
||||
|
||||
function bootLoader() {
|
||||
|
||||
global.eventHandler.createEventHandler('Jason-Multi-Period')
|
||||
global.systemEventHandler.createEventHandler('Jason-Multi-Period')
|
||||
|
||||
tryToListenToCockpit()
|
||||
|
||||
function tryToListenToCockpit() {
|
||||
|
||||
global.eventHandler.listenToEvent('Cockpit-Restart-Simulation', 'Simulation Started', undefined, 'Clone Executor Boot Loader', onResponse, startSequence)
|
||||
global.systemEventHandler.listenToEvent('Cockpit-Restart-Simulation', 'Simulation Started', undefined, 'Clone Executor Boot Loader', onResponse, startSequence)
|
||||
|
||||
function onResponse(message) {
|
||||
if (message.result !== global.DEFAULT_OK_RESPONSE.result) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newEventHandler = function newEventHandler() {
|
||||
exports.newSystemEventHandler = function newSystemEventHandler() {
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
createEventHandler: createEventHandler,
|
||||
Reference in new issue
Block a user