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

One mistake in the article of guides #1542

Closed
evanzlj opened this issue Jan 4, 2018 · 2 comments
Closed

One mistake in the article of guides #1542

evanzlj opened this issue Jan 4, 2018 · 2 comments
Labels
i18n Issues/PRs related to the Website Internationalisation

Comments

@evanzlj
Copy link

evanzlj commented Jan 4, 2018

Thanks for this article, but when I try to convert this to chinese, I find a error:

Say that listen() is run at the beginning of the event loop, but the listening callback is placed in a setImmediate().

I think the listening callback is placed in the nextTick queue, right?~~

@gibfahn
Copy link
Member

gibfahn commented Jan 7, 2018

Say that listen() is run at the beginning of the event loop, but the listening callback is placed in a setImmediate(). Unless a hostname is passed, binding to the port will happen immediately. For the event loop to proceed, it must hit the poll phase, which means there is a non-zero chance that a connection could have been received allowing the connection event to be fired before the listening event.

As I understand it, this paragraph is explaining why the listening callback needs to be placed in the nextTick queue, by saying that if it was a setImmediate(), then it would cause problems.

I think the confusion here is the use of the word Say, I would translate Say as 假如 , as in 假如on('listening')是个setImmediate(),会出......的问题,所以得用process.nextTick().

Original PR to add this was: nodejs/node#4936 FWIW

@gibfahn gibfahn added the i18n Issues/PRs related to the Website Internationalisation label Jan 7, 2018
@evanzlj
Copy link
Author

evanzlj commented Jan 7, 2018

Got it! Thanks for your help~~^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Issues/PRs related to the Website Internationalisation
Projects
None yet
Development

No branches or pull requests

3 participants
@gibfahn @evanzlj and others