diff options
author | Blaž Hrastnik | 2021-05-06 04:56:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-06 04:56:34 +0000 |
commit | 355ad3cb8289611b06cd42fa62ddfe0a5c716e83 (patch) | |
tree | 7c94da6e122a9ecf542103b46a3ca9e80654a52e /helix-term/src/main.rs | |
parent | 0e5308bce1a6e7d7d00854ae50902546cea9578d (diff) |
Tokio migration.
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r-- | helix-term/src/main.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 612f8cf0..b0d244b7 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -14,8 +14,6 @@ use std::path::PathBuf; use anyhow::Error; -static EX: smol::Executor = smol::Executor::new(); - fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> { let mut base_config = fern::Dispatch::new(); @@ -88,12 +86,12 @@ fn main() { Loader::new(config) }); - for _ in 0..num_cpus::get() { - std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>()))); - } + let runtime = tokio::runtime::Runtime::new().unwrap(); - let mut app = Application::new(args, &EX).unwrap(); + // TODO: use the thread local executor to spawn the application task separately from the work pool + runtime.block_on(async move { + let mut app = Application::new(args).unwrap(); - // we use the thread local executor to spawn the application task separately from the work pool - smol::block_on(app.run()); + app.run().await; + }); } |