diff --git a/src/node_platform.cc b/src/node_platform.cc index 47c4373a0f7d6e..8c097c03c7d357 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -257,6 +257,16 @@ void PerIsolatePlatformData::PostDelayedTask( uv_async_send(flush_tasks_); } +void PerIsolatePlatformData::PostNonNestableTask(std::unique_ptr task) { + PostTask(std::move(task)); +} + +void PerIsolatePlatformData::PostNonNestableDelayedTask( + std::unique_ptr task, + double delay_in_seconds) { + PostDelayedTask(std::move(task), delay_in_seconds); +} + PerIsolatePlatformData::~PerIsolatePlatformData() { Shutdown(); } diff --git a/src/node_platform.h b/src/node_platform.h index 55a1e806180d34..c3a1fb04fa7ca5 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -64,6 +64,13 @@ class PerIsolatePlatformData : double delay_in_seconds) override; bool IdleTasksEnabled() override { return false; } + // Non-nestable tasks are treated like regular tasks. + bool NonNestableTasksEnabled() const override { return true; } + bool NonNestableDelayedTasksEnabled() const override { return true; } + void PostNonNestableTask(std::unique_ptr task) override; + void PostNonNestableDelayedTask(std::unique_ptr task, + double delay_in_seconds) override; + void AddShutdownCallback(void (*callback)(void*), void* data); void Shutdown();