How to use the defer function from bluebird
Find comprehensive JavaScript bluebird.defer code examples handpicked from public code repositorys.
5 6 7 8 9 10 11 12 13 14
// Returns a promise that will be resolved with an array of open ports test: bluebird.method(function(port, iface, callback) { var that = this; var log = debug('portastic:test'); var def = bluebird.defer(); // Callback handling def.promise .then(function(ports) {
8
76
1
+ 3 other calls in file
68 69 70 71 72 73 74 75 76 77
} // Export module.exports.gracefullyKill = function(proc, timeout) { function killer(signal) { var deferred = Promise.defer() function onExit() { deferred.resolve() }
5
11
3
+ 3 other calls in file
GitHub: bvschwartz/nock-step
871 872 873 874 875 876 877 878 879 880
that.pushEval(tree); function pushEval(tree) { console.log("pushEval expression: " + arrayToNock(tree)); var resolver = Promise.defer(); var nocker = findNocker(tree, that); if (!nocker) { console.log("could not find a nocker"); return Promise.resolve(undefined);
2
11
0
+ 7 other calls in file
14 15 16 17 18 19 20 21 22 23
* @returns {*} */ init(config) { const logger = require('cf-logs').Logger('codefresh:infra:redis'); // eslint-disable-line this.logger = logger; const deferred = Promise.defer(); // TODO a fallback for case where redis is not up. should be removed once redis is fully used setTimeout(() => { deferred.resolve();
0
2
11
+ 5 other calls in file
bluebird.reject is the most popular function in bluebird (2988 examples)