Skip to content

Commit 7ec898f

Browse files
committed
feat: use async_executor::StaticExecutor
1 parent d422915 commit 7ec898f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tokio03 = ["tokio03-crate"]
2121

2222
[dependencies]
2323
async-channel = "^2.1.1"
24-
async-executor = "^1.8"
24+
async-executor = { version = "^1.12", features = ["static"] }
2525
async-lock = "^3.2"
2626
blocking = "^1.5"
2727
futures-lite = "^2.0"

src/executor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::Task;
2-
use async_executor::{Executor, LocalExecutor};
2+
use async_executor::{LocalExecutor, StaticExecutor};
33
use std::future::Future;
44

5-
pub(crate) static GLOBAL_EXECUTOR: Executor<'_> = Executor::new();
5+
pub(crate) static GLOBAL_EXECUTOR: StaticExecutor = StaticExecutor::new();
66

77
thread_local! {
8-
pub(crate) static LOCAL_EXECUTOR: LocalExecutor<'static> = LocalExecutor::new();
8+
pub(crate) static LOCAL_EXECUTOR: LocalExecutor<'static> = const { LocalExecutor::new() };
99
}
1010

1111
/// Runs the global and the local executor on the current thread

src/threading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static GLOBAL_EXECUTOR_EXPECTED_THREADS_NUMBER: Mutex<usize> = Mutex::new(0);
1313
thread_local! {
1414
// Used to shutdown a thread when we receive a message from the Sender.
1515
// We send an ack using to the Receiver once we're finished shutting down.
16-
static THREAD_SHUTDOWN: OnceCell<(Sender<()>, Receiver<()>)> = OnceCell::new();
16+
static THREAD_SHUTDOWN: OnceCell<(Sender<()>, Receiver<()>)> = const { OnceCell::new() };
1717
}
1818

1919
/// Spawn more executor threads, up to configured max value.

0 commit comments

Comments
 (0)