build/nativeJS/job-manager-server.js
function granted(data, socket) {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            logger.debug(`i grant access to ${util.format(data.id)}`);
            broadcast('available');
            let socketNamespace = data.id;
            let newData = {
                script: ss.createStream(),
                inputs: {}
            };
            for (let inputSymbol in data.inputs) {
                //let filePath = data.inputs[inputSymbol];
                //logger.debug(`-->${filePath}`);
                newData.inputs[inputSymbol] = ss.createStream();
                logger.debug(`ssStream emission for input symbol '${inputSymbol}'`);
                ss(socket).emit(socketNamespace + "/" + inputSymbol, newData.inputs[inputSymbol]);
                //logger.warn('IeDump from' +  socketNamespace + "/" + inputSymbol);
                //newData.inputs[inputSymbol].pipe(process.stdout)
            }
            ss(socket).emit(socketNamespace + "/script", newData.script);
            //logger.error(`TOTOT2\n${util.format(newData)}`);
            for (let k in data) {
                if (k !== 'inputs' && k !== 'script')
                    newData[k] = data[k];
            }
            newData.socket = socket;
            socket.emit('granted', { jobID: data.id });
            resolve(newData);
        }, 250);
    });
}
function granted(data, socket) {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            logger.debug(`i grant access to ${util.format(data.id)}`);
            broadcast('available');
            let socketNamespace = data.id;
            let newData = {
                script: ss.createStream(),
                inputs: {}
            };
            for (let inputSymbol in data.inputs) {
                //let filePath = data.inputs[inputSymbol];
                //logger.debug(`-->${filePath}`);
                newData.inputs[inputSymbol] = ss.createStream();
                logger.debug(`ssStream emission for input symbol '${inputSymbol}'`);
                ss(socket).emit(socketNamespace + "/" + inputSymbol, newData.inputs[inputSymbol]);
                //logger.warn('IeDump from' +  socketNamespace + "/" + inputSymbol);
                //newData.inputs[inputSymbol].pipe(process.stdout)
            }
            ss(socket).emit(socketNamespace + "/script", newData.script);
            //logger.error(`TOTOT2\n${util.format(newData)}`);
            for (let k in data) {
                if (k !== 'inputs' && k !== 'script')
                    newData[k] = data[k];
            }
            newData.socket = socket;
            socket.emit('granted', { jobID: data.id });
            resolve(newData);
        }, 250);
    });
}
function granted ( data , socket ) { return new Promise ( ( resolve , reject ) => { setTimeout ( ( ) => { logger . debug ( ` ${ util . format ( data . id ) } ` ) ; broadcast ( 'available' ) ; let socketNamespace = data . id ; let newData = { script : ss . createStream ( ) , inputs : { } } ; for ( let inputSymbol in data . inputs ) { //let filePath = data.inputs[inputSymbol]; //logger.debug(`-->${filePath}`); newData . inputs [ inputSymbol ] = ss . createStream ( ) ; logger . debug ( ` ${ inputSymbol } ` ) ; ss ( socket ) . emit ( socketNamespace + "/" + inputSymbol , newData . inputs [ inputSymbol ] ) ; //logger.warn('IeDump from' +  socketNamespace + "/" + inputSymbol); //newData.inputs[inputSymbol].pipe(process.stdout) } ss ( socket ) . emit ( socketNamespace + "/script" , newData . script ) ; //logger.error(`TOTOT2\n${util.format(newData)}`); for ( let k in data ) { if ( k !== 'inputs' && k !== 'script' ) newData [ k ] = data [ k ] ; } newData . socket = socket ; socket . emit ( 'granted' , { jobID : data . id } ) ; resolve ( newData ) ; } , 250 ) ; } ) ; }
We build streams only at granted
We build streams only at granted