| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Once `worker.terminate()` is called, the Worker instance will be destroyed as soon as possible anyway, so in order to make the Promise returned by `worker.terminate()` resolve always, it should be okay to just call `.ref()` on it and keep the main event loop alive temporarily.
Sorry, something went wrong.
|
Shouldn't microTasks still be called after we get a success callback in C++? What am I missing? |
Sorry, something went wrong.
|
@Fishrock123 I’m not sure I understand your question, but the way that this change works is that it keeps the Worker’s uv_async_t(s) alive until its exit notification arrives on the main loop, and the microtask queue is not really involved here. |
Sorry, something went wrong.
Once `worker.terminate()` is called, the Worker instance will be destroyed as soon as possible anyway, so in order to make the Promise returned by `worker.terminate()` resolve always, it should be okay to just call `.ref()` on it and keep the main event loop alive temporarily. PR-URL: #29484 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Once `worker.terminate()` is called, the Worker instance will be destroyed as soon as possible anyway, so in order to make the Promise returned by `worker.terminate()` resolve always, it should be okay to just call `.ref()` on it and keep the main event loop alive temporarily. PR-URL: #29484 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Once `worker.terminate()` is called, the Worker instance will be destroyed as soon as possible anyway, so in order to make the Promise returned by `worker.terminate()` resolve always, it should be okay to just call `.ref()` on it and keep the main event loop alive temporarily. PR-URL: #29484 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
| Back | FazBrowse Home | New Git URL |
Once worker.terminate() is called, the Worker instance will be
destroyed as soon as possible anyway, so in order to make
the Promise returned by worker.terminate() resolve always,
it should be okay to just call .ref() on it and keep the main
event loop alive temporarily.
Checklist