How to use q.Promise:
GitHub: namshi/roger
11 12 13 14 15 16 17 18 19 20
} docker.client = new Docker(config.get('docker.client')); function extractAndRepackage(project, imageId, builderId, buildId, buildLogger, dockerOptions, uuid) { return Q.Promise(function(resolve, reject) { delete dockerOptions.dockerfile; var extractPath = project.build.extract; extractPath += (extractPath[extractPath.length] === '/') ? '.' : '/.'; buildLogger.info('Boldly extracting produced stuff form: ', extractPath);
25
126
42
See more examples
How to use q.resolve:
GitHub: bower/bower
31 32 33 34 35 36 37 38 39 40
// Use https:// rather than git:// (PR #2611) this._source = this._source.replace('git://', 'https://'); // Enable shallow clones for GitHub repos this._shallowClone = function() { return Q.resolve(true); }; } util.inherits(GitHubResolver, GitRemoteResolver);
0
0
722
See more examples
How to use q.delay:
GitHub: rstacruz/pomo.js
71 72 73 74 75 76 77 78 79
self.work.initial(); self.start = self.now(); self.interrupted = false; return Q.delay(1000); }).then(function() { /* Work: start */ return self.work.start();
How to use q.promise:
GitHub: jamovi/jamovi
32 33 34 35 36 37 38 39 40 41
return this.connected; let url = `${ window.location.origin }${ window.location.pathname }coms`; url = url.replace('http', 'ws'); // http -> ws, https -> wss return new Q.promise((resolve, reject) => { this._ws = new WebSocket(url); this._ws.binaryType = 'arraybuffer'; this._opened = false;
52
453
26
See more examples
How to use q.nfcall:
55 56 57 58 59 60 61 62 63
type: 'token', token: program.password }); const reportRateLimit = () => { return Q.nfcall(github.misc.rateLimit, {}) .then(d => d.resources.core.remaining) .then(sideEffect(d => console.log('Rate limit remaining', d))); };
How to use q.defer:
GitHub: namshi/roger
208 209 210 211 212 213 214 215 216 217
* Tags "branch" off the latest imageId. * * @return promise */ docker.tag = function(imageId, buildId, branch) { var deferred = Q.defer(); var image = docker.client.getImage(imageId + ':' + branch); image.tag({repo: imageId, tag: branch}, function() { deferred.resolve(docker.client.getImage(imageId));
25
126
42
See more examples