Remote Backends Implemented

This commit is contained in:
Luis Fernando Molina committed 2020-04-22 13:57:49 +02:00
1 parent 5ed0fcaa23
commit d307f1c028
5 files changed
+64 -6

No files matched your search

+2 -2
View File
@@ -45,7 +45,7 @@ function newDailyFiles () {
}
}
function initialize (pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pDatetime, pTimeFrame, pHost, pPort, callBackFunction) {
function initialize (pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pDatetime, pTimeFrame, pHost, pPort, pEventsServerClient, callBackFunction) {
try {
callBackWhenFileReceived = callBackFunction
@@ -114,7 +114,7 @@ function newDailyFiles () {
if (pDataset.code.validTimeFrames.includes(periodName) === true) {
let fileCursor = newFileCursor()
fileCursor.eventHandler = thisObject.eventHandler // We share our event handler with each file cursor, so that they can raise events there when files are changed.s
fileCursor.initialize(fileCloud, pDataMine, pBot, pSession, pProduct, pDataset, exchange, pMarket, periodName, periodTime, pDatetime, pTimeFrame, beginDateRange, endDateRange, onInitialized)
fileCursor.initialize(fileCloud, pDataMine, pBot, pSession, pProduct, pDataset, exchange, pMarket, periodName, periodTime, pDatetime, pTimeFrame, beginDateRange, endDateRange, pEventsServerClient, onInitialized)
function onInitialized (err) {
try {
switch (err.result) {
+20 -1
View File
@@ -34,6 +34,7 @@ function newFileCursor () {
let timeFrame
let beginDateRange
let endDateRange
let eventsServerClient
let finalized = false
@@ -61,6 +62,7 @@ function newFileCursor () {
timeFrame = undefined
beginDateRange = undefined
endDateRange = undefined
eventsServerClient = undefined
thisObject.files = undefined
cursorDate = undefined
@@ -73,7 +75,23 @@ function newFileCursor () {
}
}
function initialize (pFileCloud, pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pPeriodName, pTimeFrame, pCursorDate, pCurrentTimeFrame, pBeginDateRange, pEndDateRange, callBackFunction) {
function initialize (
pFileCloud,
pDataMine,
pBot,
pSession,
pProduct,
pDataset,
pExchange,
pMarket,
pPeriodName,
pTimeFrame,
pCursorDate,
pCurrentTimeFrame,
pBeginDateRange,
pEndDateRange,
pEventsServerClient,
callBackFunction) {
try {
market = pMarket
exchange = pExchange
@@ -88,6 +106,7 @@ function newFileCursor () {
timeFrame = pTimeFrame
beginDateRange = pBeginDateRange
endDateRange = pEndDateRange
eventsServerClient = pEventsServerClient
let key = dataMine.code.codeName + '-' + bot.code.codeName + '-' + product.code.codeName + '-' + dataset.code.codeName + '-' + exchange.name + '-' + market.baseAsset + '/' + market.quotedAsset
let callerId = key + '-' + periodName + newUniqueId()
+15 -1
View File
@@ -32,6 +32,7 @@ function newFileSequence () {
let eventSubscriptionIdDatasetUpdated
let callerId
let eventsServerClient
return thisObject
@@ -52,6 +53,7 @@ function newFileSequence () {
session = undefined
dataset = undefined
product = undefined
eventsServerClient = undefined
finalized = true
} catch (err) {
@@ -59,7 +61,18 @@ function newFileSequence () {
}
}
function initialize (pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pHost, pPort, callBackFunction) {
function initialize (
pDataMine,
pBot,
pSession,
pProduct,
pDataset,
pExchange,
pMarket,
pHost,
pPort,
pEventsServerClient,
callBackFunction) {
try {
exchange = pExchange
market = pMarket
@@ -68,6 +81,7 @@ function newFileSequence () {
session = pSession
dataset = pDataset
product = pProduct
eventsServerClient = pEventsServerClient
fileCloud = newFileCloud()
fileCloud.initialize(bot, pHost, pPort)
+15 -1
View File
@@ -37,6 +37,7 @@ function newMarketFiles () {
let finalized = false
let eventSubscriptionIdDatasetUpdated = []
let eventsServerClient
return thisObject
@@ -60,6 +61,7 @@ function newMarketFiles () {
dataset = undefined
product = undefined
periodName = undefined
eventsServerClient = undefined
finalized = true
} catch (err) {
@@ -67,7 +69,18 @@ function newMarketFiles () {
}
}
function initialize (pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pHost, pPort, callBackFunction) {
function initialize (
pDataMine,
pBot,
pSession,
pProduct,
pDataset,
pExchange,
pMarket,
pHost,
pPort,
pEventsServerClient,
callBackFunction) {
try {
exchange = pExchange
market = pMarket
@@ -76,6 +89,7 @@ function newMarketFiles () {
session = pSession
dataset = pDataset
product = pProduct
eventsServerClient = pEventsServerClient
fileCloud = newFileCloud()
fileCloud.initialize(pBot, pHost, pPort)
+12 -1
View File
@@ -16,7 +16,18 @@ function newSingleFile () {
return thisObject
function initialize (pDataMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pHost, pPort, callBackFunction) {
function initialize (
pDataMine,
pBot,
pSession,
pProduct,
pDataset,
pExchange,
pMarket,
pHost,
pPort,
pEventsServerClient,
callBackFunction) {
try {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') }
if (INFO_LOG === true) { logger.write('[INFO] initialize -> key = ' + pDataMine.code.codeName + '-' + pBot.code.codeName + '-' + pProduct.code.codeName) }