Coder Social home page Coder Social logo

Comments (6)

diwic avatar diwic commented on August 15, 2024

Hi,

I tried to run the example and it fails to compile with the following errors:

error[E0432]: unresolved import `tokio::sync::Mutex`
 --> dbus-tokio/examples/bug402.rs:1:5
  |
1 | use tokio::sync::Mutex;
  | 
    ^^^^^^^^^^^^^^^^^^ no `Mutex` in `sync`

error[E0603]: module `sync` is private
   --> dbus-tokio/examples/bug402.rs:1:12
    |
1   | use tokio::sync::Mutex;
    |            ^^^^ private module
    |

Could you provide a matching Cargo.toml, full repo or something? Thanks!

from dbus-rs.

zevweiss avatar zevweiss commented on August 15, 2024

Ah, sorry about that -- the following Cargo.toml should work:

[package]
name = "bugdemo"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1.22", features = ["full"] }
dbus = "0.9"
dbus-tokio = "0.7"
dbus-crossroads = "0.5"
futures = "0.3"

from dbus-rs.

diwic avatar diwic commented on August 15, 2024

Writing this for myself mostly:

There are multiple Option<Context> here and the one that needs to get async support / send_on_drop in order to actually send the message when dropped:

        ctx.do_reply(|msg| {
            msg.append_all((&rr.temp_map,));
        });

Is not getting it because it is not sent into the methods - Propctx::set_send_on_drop tries to set it but there is no context for that to set it. Therefore the message is dropped without being actually being sent.

from dbus-rs.

diwic avatar diwic commented on August 15, 2024

I believed I fixed it now. If you would submit a PR adding your reproducer into dbus-crossroads/test.rs, that would be appreciated. Thanks!

from dbus-rs.

zevweiss avatar zevweiss commented on August 15, 2024

Hmm, unfortunately after updating Cargo.toml to specify the latest versions that include commit 971a151 (dbus-crossroads 0.5.1 and dbus 0.9.6) I still see my busctlhanging before eventually timing out. I thought maybe I was still somehow running a stale version with the old code, but even after a cargo clean and cargo update followed by another from-scratch cargo build its behavior doesn't seem to change.

from dbus-rs.

zevweiss avatar zevweiss commented on August 15, 2024

...ah, and now of course I realize I misread the order of the commits in the git commits I fetched, and those versions actually did not include the relevant commit. After testing with the right code the problem does indeed appear to be fixed (and I've created a PR adding a test as #405).

from dbus-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.