IPC removed, replaced by WS
This commit is contained in:
1 parent
ba4217fb24
commit
656c193511
503 files changed
+28128
-34498
No files matched your search
+1
-1
@@ -131,7 +131,7 @@ function newCanvas () {
|
||||
|
||||
thisObject.animation = animation
|
||||
/* Low Level Infraestructure First */
|
||||
animation.addCallBackFunction('System Event Handler Physics', systemEventHandler.physics)
|
||||
animation.addCallBackFunction('System Event Handler Physics', eventsServerClient.physics)
|
||||
|
||||
/* Spcaces Physics */
|
||||
animation.addCallBackFunction('CockpitSpace Physics', thisObject.cockpitSpace.physics)
|
||||
|
||||
@@ -65,7 +65,7 @@ function newSessionFunctions () {
|
||||
tradingSystem: JSON.stringify(tradingSystem)
|
||||
}
|
||||
|
||||
systemEventHandler.raiseEvent(key, 'Run Session', event)
|
||||
eventsServerClient.raiseEvent(key, 'Run Session', event)
|
||||
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
@@ -75,7 +75,7 @@ function newSessionFunctions () {
|
||||
|
||||
function stopSession (node, functionLibraryProtocolNode, callBackFunction) {
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
systemEventHandler.raiseEvent(key, 'Stop Session')
|
||||
eventsServerClient.raiseEvent(key, 'Stop Session')
|
||||
|
||||
node.payload.uiObject.stop(callBackFunction)
|
||||
}
|
||||
|
||||
@@ -68,12 +68,12 @@ function newTaskFunctions () {
|
||||
|
||||
if (node.payload.parentNode === undefined) {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
systemEventHandler.raiseEvent('Task Server', 'Debug Task Started', event)
|
||||
eventsServerClient.raiseEvent('Task Server', 'Debug Task Started', event)
|
||||
return
|
||||
}
|
||||
|
||||
node.payload.uiObject.run(callBackFunction)
|
||||
systemEventHandler.raiseEvent('Task Manager', 'Run Task', event)
|
||||
eventsServerClient.raiseEvent('Task Manager', 'Run Task', event)
|
||||
}
|
||||
|
||||
function stopTask (node, functionLibraryProtocolNode, callBackFunction) {
|
||||
@@ -83,7 +83,7 @@ function newTaskFunctions () {
|
||||
}
|
||||
|
||||
node.payload.uiObject.stop(callBackFunction)
|
||||
systemEventHandler.raiseEvent('Task Manager', 'Stop Task', event)
|
||||
eventsServerClient.raiseEvent('Task Manager', 'Stop Task', event)
|
||||
|
||||
if (node.bot === undefined) { return }
|
||||
if (node.bot.processes.length === 0) { return }
|
||||
|
||||
@@ -32,7 +32,7 @@ function newCircularProgressBar () {
|
||||
function finalize () {
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
if (eventSubscriptionIdHeartbeat !== undefined) {
|
||||
systemEventHandler.stopListening(key, eventSubscriptionIdHeartbeat)
|
||||
eventsServerClient.stopListening(key, eventSubscriptionIdHeartbeat)
|
||||
}
|
||||
|
||||
thisObject.container = undefined
|
||||
@@ -48,7 +48,7 @@ function newCircularProgressBar () {
|
||||
}
|
||||
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
systemEventHandler.listenToEvent(key, 'Heartbeat', undefined, key, onResponse, onHeartBeat)
|
||||
eventsServerClient.listenToEvent(key, 'Heartbeat', undefined, key, onResponse, onHeartBeat)
|
||||
|
||||
function onResponse (message) {
|
||||
eventSubscriptionIdHeartbeat = message.eventSubscriptionId
|
||||
|
||||
@@ -122,10 +122,10 @@ function newUiObject () {
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
|
||||
if (eventSubscriptionIdOnRunning !== undefined) {
|
||||
systemEventHandler.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
|
||||
eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
|
||||
}
|
||||
if (eventSubscriptionIdOnStopped !== undefined) {
|
||||
systemEventHandler.stopListening(key, eventSubscriptionIdOnStopped, 'UiObject')
|
||||
eventsServerClient.stopListening(key, eventSubscriptionIdOnStopped, 'UiObject')
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
|
||||
@@ -759,7 +759,7 @@ function newUiObject () {
|
||||
|
||||
/* We will wait to hear the Running event in order to confirm the execution was really started */
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
systemEventHandler.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning)
|
||||
eventsServerClient.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning)
|
||||
|
||||
onRunningCallBackFunction = callBackFunction
|
||||
|
||||
@@ -771,7 +771,7 @@ function newUiObject () {
|
||||
if (thisObject.payload === undefined) { return }
|
||||
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
systemEventHandler.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
|
||||
eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
|
||||
|
||||
thisObject.isRunning = true
|
||||
|
||||
@@ -801,7 +801,7 @@ function newUiObject () {
|
||||
function stop (callBackFunction, event) {
|
||||
/* We will wait to the event that the execution was terminated in order to call back the menu item */
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
systemEventHandler.listenToEvent(key, 'Stopped', undefined, 'UiObject', onResponse, onStopped)
|
||||
eventsServerClient.listenToEvent(key, 'Stopped', undefined, 'UiObject', onResponse, onStopped)
|
||||
|
||||
function onResponse (message) {
|
||||
eventSubscriptionIdOnStopped = message.eventSubscriptionId
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
let canvas
|
||||
let markets
|
||||
let systemEventHandler
|
||||
let eventsServerClient
|
||||
|
||||
let APP_SCHEMA_MAP = new Map()
|
||||
let APP_SCHEMA_ARRAY = []
|
||||
@@ -24,8 +24,8 @@ function newDashboard () {
|
||||
try {
|
||||
setBrowserEvents()
|
||||
|
||||
systemEventHandler = newSystemEventHandler()
|
||||
systemEventHandler.initialize(setUpAppSchema)
|
||||
eventsServerClient = newEventsServerClient()
|
||||
eventsServerClient.initialize(setUpAppSchema)
|
||||
|
||||
function setUpAppSchema () {
|
||||
APP_SCHEMA_ARRAY = getAppSchema()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
function newSystemEventHandler () {
|
||||
function newEventsServerClient () {
|
||||
/* Web Sockets Connection */
|
||||
|
||||
const MODULE_NAME = 'System Event Handler'
|
||||
@@ -71,7 +71,7 @@ function newSystemEventHandler () {
|
||||
commandsWaitingConfirmation.set(stringNonce, command)
|
||||
commandsSentByTimestamp.set(stringNonce, timestamp)
|
||||
|
||||
let messageToWebSocketServer = stringNonce + '->' + JSON.stringify(command)
|
||||
let messageToWebSocketServer = 'Web Browser|' + stringNonce + '|' + JSON.stringify(command)
|
||||
WEB_SOCKETS_CONNECTION.send(messageToWebSocketServer)
|
||||
}
|
||||
|
||||
@@ -164,9 +164,6 @@ function newSystemEventHandler () {
|
||||
function setuptWebSockets (callBackFunction) {
|
||||
try {
|
||||
WEB_SOCKETS_CONNECTION = new WebSocket(WEB_SOCKETS_URL)
|
||||
WEB_SOCKETS_CONNECTION.onopen = () => {
|
||||
console.log('Websocket connection opened.')
|
||||
}
|
||||
WEB_SOCKETS_CONNECTION.onerror = error => {
|
||||
console.log('WebSocket error:' + JSON.stringify(error))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user