1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
--- a/examples/watch-systemd-jobs.rs
+++ b/examples/watch-systemd-jobs.rs
@@ -9,10 +9,17 @@
use zbus_macros::proxy;
use zvariant::OwnedObjectPath;
+#[cfg(feature="async-io")]
fn main() {
async_io::block_on(watch_systemd_jobs()).expect("Error listening to signal");
}
+#[cfg(not(feature="async-io"))]
+fn main() {
+ let runtime = tokio::runtime::Runtime::new().unwrap();
+ runtime.block_on(watch_systemd_jobs()).expect("Error listening to signal");
+}
+
#[proxy(
default_service = "org.freedesktop.systemd1",
default_path = "/org/freedesktop/systemd1",
|