Skip to content
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

Can't use sensors::temperatures function in different thread #354

Open
ravenclaw900 opened this issue Nov 27, 2021 · 0 comments
Open

Can't use sensors::temperatures function in different thread #354

ravenclaw900 opened this issue Nov 27, 2021 · 0 comments

Comments

@ravenclaw900
Copy link

ravenclaw900 commented Nov 27, 2021

If the sensors::temperatures function is spawned into a different thread, it fails with implementation of `std::ops::FnOnce` is not general enough.

MWE:

use futures::StreamExt;
use heim::sensors;

#[tokio::main]
async fn main() {
    tokio::spawn(async {
        sensors::temperatures()
            .collect::<Vec<Result<sensors::TemperatureSensor, heim::Error>>>()
            .await
    });
}
ravenclaw900 added a commit to ravenclaw900/DietPi-Dashboard that referenced this issue Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant