summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-07-06 19:42:52 +0200
committerGitHub <noreply@github.com>2021-07-06 19:42:52 +0200
commitbdfad23dd012d0c3226b466544e86109da18d09c (patch)
treef59bfc463f29047df80c48abbe299e55a16b8622 /runtime/worker.rs
parent672a88f2727286233ab904e23a9145aa5563a834 (diff)
feat: support SharedArrayBuffer sharing between workers (#11040)
This commit adds support for sharing SABs between workers.
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 555fc89d2..04c294146 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -22,6 +22,7 @@ use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
+use deno_core::SharedArrayBufferStore;
use deno_web::BlobStore;
use log::debug;
use std::env;
@@ -70,6 +71,7 @@ pub struct WorkerOptions {
pub origin_storage_dir: Option<std::path::PathBuf>,
pub blob_store: BlobStore,
pub broadcast_channel: InMemoryBroadcastChannel,
+ pub shared_array_buffer_store: Option<SharedArrayBufferStore>,
}
impl MainWorker {
@@ -136,6 +138,7 @@ impl MainWorker {
startup_snapshot: Some(js::deno_isolate_init()),
js_error_create_fn: options.js_error_create_fn.clone(),
get_error_class_fn: options.get_error_class_fn,
+ shared_array_buffer_store: options.shared_array_buffer_store.clone(),
extensions,
..Default::default()
});
@@ -300,6 +303,7 @@ mod tests {
origin_storage_dir: None,
blob_store: BlobStore::default(),
broadcast_channel: InMemoryBroadcastChannel::default(),
+ shared_array_buffer_store: None,
};
MainWorker::from_options(main_module, permissions, &options)