From 80d91538732406808714e18ad63b0898702faaf4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 23 May 2016 19:19:09 +0300 Subject: [PATCH] minor fix and started work on generating previews in a separate process... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/sharp.js | 6 +++--- ui (gen4)/workers/preview-constructor.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 ui (gen4)/workers/preview-constructor.js diff --git a/ui (gen4)/features/sharp.js b/ui (gen4)/features/sharp.js index c252cd8f..e1f365ef 100755 --- a/ui (gen4)/features/sharp.js +++ b/ui (gen4)/features/sharp.js @@ -57,14 +57,14 @@ var SharpActions = actions.Actions({ }, // XXX BUG (nw.js): this does not work until child_process.fork(..) is fixed... - startWorker: ['- Sharp/', + startPreviewWorker: ['- Sharp/', function(){ if(this.previewConstructorWorker){ return } - this.previewConstructorWorker = cp.form('./worker/preview-constructor.js') + this.previewConstructorWorker = cp.fork('./workers/preview-constructor.js') }], - stopWorker: ['- Sharp/', + stopPreviewWorker: ['- Sharp/', function(){ this.previewConstructorWorker && this.previewConstructorWorker.kill() delete this.previewConstructorWorker diff --git a/ui (gen4)/workers/preview-constructor.js b/ui (gen4)/workers/preview-constructor.js new file mode 100755 index 00000000..66386bf9 --- /dev/null +++ b/ui (gen4)/workers/preview-constructor.js @@ -0,0 +1,19 @@ +/********************************************************************** +* +* +* +**********************************************************************/ + +var sharp = require('sharp') + + +/*********************************************************************/ + +process.on('message', function(m){ + console.log('Got:', m) +}) + + + +/********************************************************************** +* vim:set ts=4 sw=4 : */