We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6ca3bf commit 0e498d5Copy full SHA for 0e498d5
.evergreen/config.yml
@@ -197,7 +197,6 @@ buildvariants:
197
198
- name: sync-api
199
display_name: "Sync API"
200
- patchable: false
201
run_on:
202
- rhel87-small
203
expansions:
src/runtime/join_handle.rs
@@ -14,7 +14,11 @@ impl<T> AsyncJoinHandle<T> {
14
F: Future<Output = T> + Send + 'static,
15
T: Send + 'static,
16
{
17
+ #[cfg(not(feature = "sync"))]
18
let handle = tokio::runtime::Handle::current();
19
+ #[cfg(feature = "sync")]
20
+ let handle = tokio::runtime::Handle::try_current()
21
+ .unwrap_or_else(|_| crate::sync::TOKIO_RUNTIME.handle().clone());
22
AsyncJoinHandle(handle.spawn(fut))
23
}
24
0 commit comments