diff options
Diffstat (limited to 'lib/bridge/monitor.js')
| -rw-r--r-- | lib/bridge/monitor.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/bridge/monitor.js b/lib/bridge/monitor.js new file mode 100644 index 0000000..d8d29ef --- /dev/null +++ b/lib/bridge/monitor.js @@ -0,0 +1,19 @@ +class Monitor { + constructor(args) { + const cmd = spawn(process.env.PYTHON_BINARY, args); + + let stdout = '', stderr = '' + + cmd.stdout.on('data', (data) => { + this.stdout += data + }) + + cmd.stderr.on('data', (data) => { + this.stderr += data + }) + + cmd.on('exit', function (code) { + exit && exit( data.toString() ) + }) + } +} |
