How to use the deasync.runLoopOnce function in deasync

To help you get started, we’ve selected a few deasync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qminer / qminer / src / nodejs / datasets / datasets.js View on Github external
base: _base
        }

        console.log('Loading dataset ' + options.store + ' ...');
        _base.loadCSV(options, function (err) {
            if (err) return callback(err);
            
            var Iris = _base.store(options.store);
            console.log(options.store + ' dataset loaded')

            finished = true;
        })

        // Used deasync module to turn this function into sync. 
        while (finished == false) {
            require('deasync').runLoopOnce();
        }
        return _base.store(options.store);
    }
github qminer / qminer / nodedoc / datasetsdoc.js View on Github external
base: _base
        }

        console.log('Loading dataset ' + options.store + ' ...');
        _base.loadCSV(options, function (err) {
            if (err) return callback(err);
            
            var Iris = _base.store(options.store);
            console.log(options.store + ' dataset loaded')

            finished = true;
        })

        // Used deasync module to turn this function into sync. 
        while (finished == false) {
            require('deasync').runLoopOnce();
        }
        return _base.store(options.store);
    }
github qminer / qminer / src / nodejs / intellisense / datasets_intellisense.js View on Github external
base: _base
        }

        console.log('Loading dataset ' + options.store + ' ...');
        _base.loadCSV(options, function (err) {
            if (err) return callback(err);
            
            var Iris = _base.store(options.store);
            console.log(options.store + ' dataset loaded')

            finished = true;
        })

        // Used deasync module to turn this function into sync. 
        while (finished == false) {
            require('deasync').runLoopOnce();
        }
        return _base.store(options.store);
    }
github pannous / angle / angle.js / extensions.js View on Github external
downloadSync2 = wget2 = (url) => {
	ret = undefined// global hack
	fetch(urlify(url)).then(response => response.text().then(data => ret = data))
	while (ret === undefined) {
		require('deasync').runLoopOnce();
	}
	return ret
}
github entith / PugViewEngine / PugViewEngine / pugViewEngine.js View on Github external
html.action = function(action, controller, routeValues){
        var actionResult;
        data.methods.action({
            action: action,
            controller: controller,
            routeValues: routeValues
        }, function(error, result){
            actionResult = result;
        });
        
        while(actionResult === undefined) {
            require('deasync').runLoopOnce();
        }
        return actionResult;
    }

deasync

Turns async function into sync via JavaScript wrapper of Node event loop

MIT
Latest version published 7 months ago

Package Health Score

69 / 100
Full package analysis