summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 172d24dea..c2356651e 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -7,6 +7,7 @@ use crate::metrics;
use crate::ops;
use crate::permissions::Permissions;
use crate::tokio_util::create_basic_runtime;
+use deno_broadcast_channel::InMemoryBroadcastChannel;
use deno_core::error::AnyError;
use deno_core::error::Context as ErrorContext;
use deno_core::futures::channel::mpsc;
@@ -230,6 +231,7 @@ pub struct WebWorkerOptions {
pub no_color: bool,
pub get_error_class_fn: Option<GetErrorClassFn>,
pub blob_url_store: BlobUrlStore,
+ pub broadcast_channel: InMemoryBroadcastChannel,
}
impl WebWorker {
@@ -268,7 +270,10 @@ impl WebWorker {
options.user_agent.clone(),
options.ca_data.clone(),
),
- deno_broadcast_channel::init(),
+ deno_broadcast_channel::init(
+ options.broadcast_channel.clone(),
+ options.unstable,
+ ),
deno_crypto::init(options.seed),
deno_webgpu::init(options.unstable),
deno_timers::init::<Permissions>(),
@@ -567,6 +572,7 @@ mod tests {
no_color: true,
get_error_class_fn: None,
blob_url_store: BlobUrlStore::default(),
+ broadcast_channel: InMemoryBroadcastChannel::default(),
};
let mut worker = WebWorker::from_options(