GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: fix n-api asynchronous threading docs · nodejs/node@1abb168

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • n-api.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+7-5Lines changed: 7 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,11 @@ napi_status napi_create_async_work(napi_env env,
32833283
- `[in] async_resource_name`: Identifier for the kind of resource that is
32843284
being provided for diagnostic information exposed by the `async_hooks` API.
32853285
- `[in] execute`: The native function which should be called to excute
3286-
the logic asynchronously.
3286+
the logic asynchronously. The given function is called from a worker pool
3287+
thread and can execute in parallel with the main event loop thread.
32873288
- `[in] complete`: The native function which will be called when the
3288-
asynchronous logic is comple or is cancelled.
3289+
asynchronous logic is completed or is cancelled. The given function is called
3290+
from the main event loop thread.
32893291
- `[in] data`: User-provided data context. This will be passed back into the
32903292
execute and complete functions.
32913293
- `[out] result`: `napi_async_work*` which is the handle to the newly created
@@ -3361,9 +3363,9 @@ callback invocation, even if it has been successfully cancelled.
33613363

33623364
## Custom Asynchronous Operations
33633365
The simple asynchronous work APIs above may not be appropriate for every
3364-
scenario, because with those the async execution still happens on the main
3365-
event loop. When using any other async mechanism, the following APIs are
3366-
necessary to ensure an async operation is properly tracked by the runtime.
3366+
scenario. When using any other asynchronous mechanism, the following APIs
3367+
are necessary to ensure an asynchronous operation is properly tracked by
3368+
the runtime.
33673369

33683370
### napi_async_init
33693371
<!-- YAML

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.