aboutsummaryrefslogtreecommitdiff
path: root/src/blocking.rs
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-11-18 13:34:39 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-11-18 13:34:39 +0100
commit526c694bcdb08da99aab6da308775fe5e0164b95 (patch)
tree376f07baebe38b0198093921c1afa1319379f448 /src/blocking.rs
parent1954c7c7e975104fa651ccded4358826e8b3c8d8 (diff)
run creation of blocking connection in a tokio runtime0.4.3
Spawning the connection requires this to be done, otherwise the caller panics.
Diffstat (limited to 'src/blocking.rs')
-rw-r--r--src/blocking.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/blocking.rs b/src/blocking.rs
index 5e5c1f9..a60fa7c 100644
--- a/src/blocking.rs
+++ b/src/blocking.rs
@@ -16,7 +16,9 @@ pub struct Connection(crate::Connection);
impl Connection {
/// Creates a new blocking wrapper around [`crate::Connection`].
pub fn new() -> crate::Result<Self> {
- Ok(Self(crate::Connection::new()?))
+ Ok(Self(
+ tokio::runtime::Runtime::new()?.block_on(crate::Connection::new())?,
+ ))
}
}