-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dbus::Connection is neither Sync nor Send #137
Comments
@albel727 You're good at these things, do you remember some weird edge case which makes it impossible for |
I started making it
Another advantage though in the fork is that a client now no longer needs to pass a So this: let conn = Rc::new(Connection::get_private(::dbus::BusType::Session).unwrap());
let mut rt = Runtime::new().unwrap();
let aconn = AConnection::new(conn.clone(), CoreHandle::current(), &mut rt).unwrap();
let f = aconn.messages().unwrap().map_err(|_| ()).for_each(|msg| {
println!("fsignal was: {:?}", msg);
Ok(())
});
rt.block_on(f).unwrap(); becomes this: let conn = Connection::get_private(::dbus::BusType::Session).unwrap();
c.add_match("type=signal,sender=org.freedesktop.DBus").unwrap();
let aconn = AConnection::new(conn);
let f = aconn.messages().unwrap().map_err(|_| ()).for_each(|msg| {
println!("signal was: {:?}", msg);
Ok(())
});
let mut rt = Runtime::new().unwrap();
rt.block_on(f).unwrap(); I hope I did not hijack this issue since this is mostly related to dbus-tokio. Anyway I would be grateful for help making this fork ready to be merged. |
So I had a look at how easy it would be to make I'm not sure how to resolve this trade-off so that people can stuff Asked question here: https://www.reddit.com/r/rust/comments/ahpelv/to_send_or_not_to_send_thats_the_question/ |
@marcelbuesing But if there are some small no-brainers in there - which don't depend on other changes - I could merge them individually before discussing the bigger architectural changes? |
Ok, so actually I'm suspecting that the best course of action here is to make a new @marcelbuesing @arcnmx what functions would you need on a connection to unblock your work? |
I'm not familiar with libdbus or its semantics, but it seems unusual that it does not at least allow migration of the connection across threads via Send. Is the lack of both of these bounds intentional?
The text was updated successfully, but these errors were encountered: