Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing: deasync hangs in an asynchronous context #21 #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Aminadav
Copy link

No description provided.

Fix: deasync hangs in an asynchronous context
@Aminadav
Copy link
Author

The following code as a test, hang before this merge, and working great after this merge.

Fixing issues: #21.
It's also fixes issues for me using node-mysql module.

var deasync = require('deasync');

function async(cb) {
console.log('1');
setTimeout(function() {
console.log('2');
cb(null, 'value');
console.log('3');
}, 0);
}

console.log('A', deasync(async)());
setTimeout(function() {
console.log('B', deasync(async)());
}, 0);

@RSsimranjeetsingh
Copy link

@AminaG : It works like a charm. No hangs anymore in async context.
Thanks a ton 👍 :)
@abbr : Request you to kindly review & merge the PR.

@utf4
Copy link

utf4 commented Jul 13, 2017

@abbr Can you please review and merge this pull request in next release?

@Richienb
Copy link

@abbr Please review this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants