Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/ECMAScript/
Node JS
Node JS
/Node Addon/Node Addon API/
node-addon-api AsyncWorker
Search

node-addon-api AsyncWorker

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2020 Jun 23 10:2
Editor
Editor
Seonglae ChoSeonglae Cho
Edited
Edited
2023 Apr 16 6:24
Refs
Refs
thread
nodejs/node-addon-api
Napi::AsyncWorker is an abstract class that you can subclass to remove many of the tedious tasks of moving data between the event loop and worker threads. This class internally handles all the details of creating and executing an asynchronous operation. Once created, execution is requested by calling Napi::AsyncWorker::Queue.
nodejs/node-addon-api
https://github.com/nodejs/node-addon-api/blob/master/doc/async_worker.md
nodejs/node-addon-api
 

Execute()

This method is used to execute some tasks outside of the event loop on a libuv worker thread.
AsyncWorker question pertaining to Execute() · Issue #73 · nodejs/node-addon-examples
In the comments for the async_pi_estimate starting at line 11, there is a part that states "It is not safe to access JS engine data structure..." Is this referring to anything that uses info.Env() or does that mean something else? What l...
AsyncWorker question pertaining to Execute() · Issue #73 · nodejs/node-addon-examples
https://github.com/nodejs/node-addon-examples/issues/73
AsyncWorker question pertaining to Execute() · Issue #73 · nodejs/node-addon-examples
can't use env
should use buffer
 
 
 
 
 
 

Recommendations

Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/ECMAScript/
Node JS
Node JS
/Node Addon/Node Addon API/
node-addon-api AsyncWorker
Copyright Seonglae Cho