@@ -105,8 +105,8 @@ virtual void Napi::AsyncWorker::Execute() = 0;
105105
106106### OnOK
107107
108- This method is invoked when the computation in the ` Excecute ` method ends.
109- The default implementation runs the Callback provided when the AsyncWorker class
108+ This method is invoked when the computation in the ` Execute ` method ends.
109+ The default implementation runs the Callback optionally provided when the AsyncWorker class
110110was created.
111111
112112``` cpp
@@ -149,7 +149,7 @@ explicit Napi::AsyncWorker(const Napi::Function& callback);
149149- `[in] callback`: The function which will be called when an asynchronous
150150operations ends. The given function is called from the main event loop thread.
151151
152- Returns a`Napi::AsyncWork ` instance which can later be queued for execution by calling
152+ Returns a `Napi::AsyncWorker ` instance which can later be queued for execution by calling
153153`Queue`.
154154
155155### Constructor
@@ -166,7 +166,7 @@ operations ends. The given function is called from the main event loop thread.
166166identifier for the kind of resource that is being provided for diagnostic
167167information exposed by the async_hooks API.
168168
169- Returns a ` Napi::AsyncWork ` instance which can later be queued for execution by
169+ Returns a ` Napi::AsyncWorker ` instance which can later be queued for execution by
170170calling ` Napi::AsyncWork::Queue ` .
171171
172172### Constructor
@@ -185,7 +185,7 @@ information exposed by the async_hooks API.
185185- `[in] resource`: Object associated with the asynchronous operation that
186186will be passed to possible async_hooks.
187187
188- Returns a `Napi::AsyncWork ` instance which can later be queued for execution by
188+ Returns a `Napi::AsyncWorker ` instance which can later be queued for execution by
189189calling `Napi::AsyncWork::Queue`.
190190
191191### Constructor
@@ -200,7 +200,7 @@ explicit Napi::AsyncWorker(const Napi::Object& receiver, const Napi::Function& c
200200- ` [in] callback ` : The function which will be called when an asynchronous
201201operations ends. The given function is called from the main event loop thread.
202202
203- Returns a ` Napi::AsyncWork ` instance which can later be queued for execution by
203+ Returns a ` Napi::AsyncWorker ` instance which can later be queued for execution by
204204calling ` Napi::AsyncWork::Queue ` .
205205
206206### Constructor
@@ -241,6 +241,54 @@ will be passed to possible async_hooks.
241241Returns a ` Napi::AsyncWork ` instance which can later be queued for execution by
242242calling ` Napi::AsyncWork::Queue ` .
243243
244+
245+ ### Constructor
246+
247+ Creates a new ` Napi::AsyncWorker ` .
248+
249+ ``` cpp
250+ explicit Napi::AsyncWorker (Napi::Env env);
251+ ```
252+
253+ - `[in] env`: The environment in which to create the `Napi::AsyncWorker`.
254+
255+ Returns an `Napi::AsyncWorker` instance which can later be queued for execution by calling
256+ `Napi::AsyncWorker::Queue`.
257+
258+ ### Constructor
259+
260+ Creates a new `Napi::AsyncWorker`.
261+
262+ ```cpp
263+ explicit Napi::AsyncWorker(Napi::Env env, const char* resource_name);
264+ ```
265+
266+ - ` [in] env ` : The environment in which to create the ` Napi::AsyncWorker ` .
267+ - ` [in] resource_name ` : Null-terminated strings that represents the
268+ identifier for the kind of resource that is being provided for diagnostic
269+ information exposed by the async_hooks API.
270+
271+ Returns a ` Napi::AsyncWorker ` instance which can later be queued for execution by
272+ calling ` Napi::AsyncWorker::Queue ` .
273+
274+ ### Constructor
275+
276+ Creates a new ` Napi::AsyncWorker ` .
277+
278+ ``` cpp
279+ explicit Napi::AsyncWorker (Napi::Env env, const char* resource_name, const Napi::Object& resource);
280+ ```
281+
282+ - `[in] env`: The environment in which to create the `Napi::AsyncWorker`.
283+ - `[in] resource_name`: Null-terminated strings that represents the
284+ identifier for the kind of resource that is being provided for diagnostic
285+ information exposed by the async_hooks API.
286+ - `[in] resource`: Object associated with the asynchronous operation that
287+ will be passed to possible async_hooks.
288+
289+ Returns a `Napi::AsyncWorker` instance which can later be queued for execution by
290+ calling `Napi::AsyncWorker::Queue`.
291+
244292### Destructor
245293
246294Deletes the created work object that is used to execute logic asynchronously.
0 commit comments