Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: use async/setImmediate vs process.nextTick
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed May 14, 2018
1 parent 7b4a0a8 commit af55608
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/components/pubsub.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const promisify = require('promisify-es6')
const setImmediate = require('async/setImmediate')

module.exports = function pubsub (self) {
return {
Expand Down Expand Up @@ -31,7 +32,7 @@ module.exports = function pubsub (self) {
return Promise.resolve()
}

process.nextTick(() => callback())
setImmediate(() => callback())
},

publish: promisify((topic, data, callback) => {
Expand Down

0 comments on commit af55608

Please sign in to comment.