Skip to content

Error: No async scheduler available

petkaantonov edited this page Dec 28, 2014 · 2 revisions

Async scheduler is a function that takes a callback function and calls the callback function as soon as possible, but asynchronously. For example setTimeout.

By default bluebird only tries a few common async schedulers, such as setTimeout, process.nextTick and MutationObserver. However if your JavaScript runtime environment doesn't expose any of these, you will see this error.

You may use Promise.setScheduler to pass a custom scheduler that your environment supports. For example in DukTape:

Promise.setScheduler(function(fn){ // fn is what to execute
    var timer = uv.new_timer.call({});
    uv.timer_start(timer, 0, 0, fn); // add the function as a callback to the timer
});