How to use the fibers/future.task function in fibers

To help you get started, we’ve selected a few fibers 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 hackhat / selenium-sync / src / core / Browser.js View on Github external
this.__driver  = options.driver;
        if(options.driverType === 'chrome'){
            this.__driver = new ChromeDriver();
    this.__windows = [];
    this.__quitted = false;

    // First update should be run in the current fiber "thread" in order
    // to setup the first window before any other call.

    // The update loop should run in another fiber "thread" to don't
    // block the current one. If not it will not go beyond this step.
        while(true && !this.__quitted){
github hackhat / cucumberry / src / core / plugins / makeFiber.js View on Github external
var fiberFn = function(){
            var args =;
            // Extract and remove the cb from the arguments.
            var cb   = args.pop();
                fn.apply(this, args);
                // Because is running with fibers is sync. Therefore
                // we can call cb() after the fn ends in sync.
        this.__makeFiber_origGiven(regexp, fiberFn);