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

js: Callbacks queued by process.nextTick weren't being called reliably #131

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

bladecoding
Copy link
Contributor

  • This issue was causing some libraries (E.g. mongodb) to have a long delay since the nextTick callbacks weren't firing until a nodejs callback happened(E.g. io callback like fs.stat). Specifically a query in mongodb would take 30 seconds due to the query callback, queued using process.nextTick, not firing until the socket connection timed out.

  • Here is a minimal repro that works in nodejs but didn't work in fivem.

setImmediate(() => {
  process.nextTick(() => {
    console.log("didn't get called in fivem");
  });
});```

…eliably

* This issue was causing some libraries (E.g. mongodb) to have a long delay since the nextTick callbacks weren't firing until a nodejs callback happened(E.g. io callback like fs.stat). Specifically a query in mongodb would take 30 seconds due to the query callback, queued using process.nextTick, not firing until the socket connection timed out.

* Here is a minimal repro that works in nodejs but didn't work in fivem.

setImmediate(() => {
  process.nextTick(() => {
    console.log("didn't get called in fivem");
  });
});
@blattersturm blattersturm merged commit 071e102 into citizenfx:master Aug 16, 2018
blattersturm pushed a commit that referenced this pull request May 4, 2020
Update finds from dysprosium
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.

2 participants