]> git.kaiwu.me - njs.git/commit
Refactored asynchronous events.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Dec 2023 16:54:18 +0000 (08:54 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Dec 2023 16:54:18 +0000 (08:54 -0800)
commit16004b37e9fee21ad8e1369023903163cf55f6a0
tree9a3a3ebead2d2bd75939b52f0dd180b5bd201b12
parent4a145c3e2d3ad910a5b85280e9c6db00ecd7a5af
Refactored asynchronous events.

To align njs with other JS engines, async events are removed from njs
core. The following functions were removed: njs_vm_add_event(),
njs_vm_del_event(), njs_vm_waiting(). Instead the host is expected
to manage async events by itself.

In addition, the posted events are renamed to jobs, to better align with
the ECMA specs. The following methods are removed: njs_vm_run().
Instead, the host is expected to call njs_vm_execute_pending_job() in a
loop to execute pending jobs. The following functions were added:
njs_vm_enqueue_job().
18 files changed:
auto/sources
external/njs_fs_module.c
external/njs_shell.c
external/njs_webcrypto_module.c
nginx/ngx_http_js_module.c
nginx/ngx_js.c
nginx/ngx_js.h
nginx/ngx_js_fetch.c
nginx/ngx_stream_js_module.c
src/njs.h
src/njs_event.c [deleted file]
src/njs_event.h
src/njs_promise.c
src/njs_vm.c
src/njs_vm.h
src/test/njs_externals_test.c
src/test/njs_externals_test.h
src/test/njs_unit_test.c