Add examples
This commit is contained in:
parent
adb98a2d89
commit
2ebbc0a828
9 changed files with 541 additions and 30 deletions
|
|
@ -38,3 +38,14 @@ impl BlockingSpawner {
|
|||
f()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for BlockingSpawner {
|
||||
fn default() -> Self {
|
||||
let allow_block_in_place = match tokio::runtime::Handle::current().runtime_flavor() {
|
||||
tokio::runtime::RuntimeFlavor::CurrentThread => false,
|
||||
tokio::runtime::RuntimeFlavor::MultiThread => true,
|
||||
_ => true,
|
||||
};
|
||||
Self::new(allow_block_in_place)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue