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

TSFN callback queue behavior clarification #48356

Closed
ekraihan opened this issue Jun 6, 2023 · 4 comments
Closed

TSFN callback queue behavior clarification #48356

ekraihan opened this issue Jun 6, 2023 · 4 comments
Labels
doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API.

Comments

@ekraihan
Copy link

ekraihan commented Jun 6, 2023

Affected URL(s)

https://nodejs.org/api/n-api.html#asynchronous-thread-safe-function-calls

Description of the problem

Does a TSFN call only one callback from its queue per iteration of the event loop or does it call all callbacks in the queue in one iteration? Or maybe there is there some other policy?

Perhaps this detail could be clarified in the docs?

Thanks!

@ekraihan ekraihan added the doc Issues and PRs related to the documentations. label Jun 6, 2023
@mhdawson
Copy link
Member

mhdawson commented Jun 6, 2023

Taking a look, will add something to the doc.

mhdawson added a commit to mhdawson/io.js that referenced this issue Jun 6, 2023
Refs: nodejs#48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>
@mhdawson
Copy link
Member

mhdawson commented Jun 6, 2023

@ekraihan added a proposed doc addition in #48367. it shows the code in terms of what we implement today, but the doc addition better captures what applications should depend on.

@ekraihan
Copy link
Author

ekraihan commented Jun 7, 2023

@mhdawson Awesome, thanks for the clarification

@legendecas legendecas added the node-api Issues and PRs related to the Node-API. label Jun 7, 2023
mhdawson added a commit that referenced this issue Jun 12, 2023
Refs: #48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@gabrielschulhof
Copy link
Contributor

Closed in #48367.

RafaelGSS pushed a commit that referenced this issue Jul 3, 2023
Refs: #48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this issue Aug 14, 2023
Refs: nodejs#48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: nodejs#48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this issue Aug 14, 2023
Refs: nodejs#48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: nodejs#48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
ruyadorno pushed a commit that referenced this issue Sep 7, 2023
Refs: #48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
ruyadorno pushed a commit that referenced this issue Sep 13, 2023
Refs: #48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

No branches or pull requests

4 participants