first commit
This commit is contained in:
commit
aa7869eb33
386 files changed
+69375
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// Relay the backtest message it when it comes in.
|
||||
|
||||
module.exports = done => {
|
||||
let backtest;
|
||||
|
||||
return {
|
||||
message: message => {
|
||||
if(message.type === 'error') {
|
||||
done(message.error);
|
||||
}
|
||||
|
||||
if(message.backtest) {
|
||||
done(null, message.backtest);
|
||||
}
|
||||
},
|
||||
exit: status => {
|
||||
if(status !== 0) {
|
||||
if(backtest)
|
||||
console.error('Child process died after finishing backtest');
|
||||
else
|
||||
done('Child process has died.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
module.exports = cb => {
|
||||
|
||||
return {
|
||||
message: message => {
|
||||
|
||||
if(message.event === 'marketUpdate')
|
||||
cb(null, {
|
||||
done: false,
|
||||
latest: message.payload
|
||||
})
|
||||
|
||||
else if(message.type === 'error') {
|
||||
cb(message.error);
|
||||
}
|
||||
|
||||
else if(message.type === 'log')
|
||||
console.log(message.log);
|
||||
},
|
||||
exit: status => {
|
||||
if(status !== 0)
|
||||
return cb('Child process has died.');
|
||||
else
|
||||
cb(null, { done: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// pass back all messages as is
|
||||
// (except for errors and logs)
|
||||
|
||||
module.exports = cb => {
|
||||
|
||||
return {
|
||||
message: message => {
|
||||
|
||||
if(message.type === 'error') {
|
||||
cb(message.error);
|
||||
}
|
||||
|
||||
else
|
||||
cb(null, message);
|
||||
|
||||
},
|
||||
exit: status => {
|
||||
if(status !== 0)
|
||||
cb('Child process has died.');
|
||||
else
|
||||
cb(null, { done: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user