diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-07-30 01:15:11 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 21:45:11 +0200 |
commit | 2b13bb694532904704c16bec4e8a47c386e681e2 (patch) | |
tree | 0021131ce86873a5aa965d79b99185b3ca5c5aff /runtime/web_worker.rs | |
parent | eece46f0d85faa90c97841a4f409be39272e809b (diff) |
feat(runtime): implement navigator.hardwareConcurrency (#11448)
This commit implements "navigator.hardwareConcurrency" API, which
supersedes "Deno.systemCpuInfo()" API (which was removed in this commit).
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r-- | runtime/web_worker.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index 5724517a0..344bb73c0 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -271,6 +271,7 @@ pub struct WebWorkerOptions { pub blob_store: BlobStore, pub broadcast_channel: InMemoryBroadcastChannel, pub shared_array_buffer_store: Option<SharedArrayBufferStore>, + pub cpu_count: usize, } impl WebWorker { @@ -412,6 +413,7 @@ impl WebWorker { "unstableFlag": options.unstable, "v8Version": deno_core::v8_version(), "location": self.main_module, + "cpuCount": options.cpu_count, }); let runtime_options_str = |