dbus2 / zbus-old

Rust D-Bus crate.
https://gitlab.freedesktop.org/dbus/zbus
Other
49 stars 13 forks source link

Usage without async-io and tokio #264

Open zeenix opened 2 years ago

zeenix commented 2 years ago

In GitLab by @mahkoh on Feb 24, 2022, 20:30

My program contains a bespoke async runtime which is not thread-safe. As such Wakers must not be passed to different threads. I was planing to integrate zbus into my program by writing a Socket implementation. However, it seems that zbus is not usable without either the async-io or tokio feature. Is there a way to use zbus without either of these two runtimes enabled?

zeenix commented 2 years ago

Hi, Interestingly I gave a talk about this very difficult topic today (you can watch it here until the recording is published).

I was planing to integrate zbus into my program by writing a Socket implementation.

Yeah, that should work.

However, it seems that zbus is not usable without either the async-io or tokio feature. Is there a way to use zbus without either of these two runtimes enabled?

Right, it's true that at the moment you've to enable either of those but:

  1. If you use your own socket, async-io is not actually used so it's just the matter of needlessly pulling the dep.

  2. It should be easy to remove this limitation but we'll need to document it well in multiple places (at least in the zbus README.md and the book). I'll look into this at some point but if you'd like this to happen soon, a merge-request would help.