mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Net: fold websocket and http tokio runtime into one (#31771)
* net: use the same tokio runtime in websocket loader #31648 * readability * license
This commit is contained in:
parent
2789e98876
commit
5c0199b568
6 changed files with 19 additions and 19 deletions
12
components/net/async_runtime.rs
Normal file
12
components/net/async_runtime.rs
Normal file
|
@ -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<Option<Runtime>> = Mutex::new(Some(Runtime::new().unwrap()));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue