From 5c0199b5687a5c0c1b2fe82235ca609c7d9ea614 Mon Sep 17 00:00:00 2001 From: tannal <149947508+tannal@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:13:03 +0800 Subject: Net: fold websocket and http tokio runtime into one (#31771) * net: use the same tokio runtime in websocket loader #31648 * readability * license --- components/net/async_runtime.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 components/net/async_runtime.rs (limited to 'components/net/async_runtime.rs') diff --git a/components/net/async_runtime.rs b/components/net/async_runtime.rs new file mode 100644 index 00000000000..c06d570d9ae --- /dev/null +++ b/components/net/async_runtime.rs @@ -0,0 +1,12 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use std::sync::Mutex; + +use lazy_static::lazy_static; +use tokio::runtime::Runtime; + +lazy_static! { + pub static ref HANDLE: Mutex> = Mutex::new(Some(Runtime::new().unwrap())); +} -- cgit v1.2.3