-
Notifications
You must be signed in to change notification settings - Fork 3
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
[IN PROGRESS] Update to mio 0.7 and tokio 0.3 #9
Conversation
Tested this using use futures::executor;
use futures::stream::StreamExt;
use std::thread;
use tokio_udev::{EventType, MonitorBuilder};
#[tokio::main]
async fn main() {
let mut monitor = MonitorBuilder::new()
.unwrap()
.match_subsystem("usb")
.unwrap()
.listen()
.unwrap();
loop {
if let Some(event) = monitor.next().await {
println!("{}", event.event_type());
for property in event.device().properties() {
println!("{:?} = {:?}", property.name(), property.value());
}
}
}
} Cargo.toml: futures = "0.3"
tokio-udev = {path = "../tokio-udev/tokio-udev"}
tokio = { version = "0.3", features = ["full"] } and it works great With tokio-udev from cargo, I actually get I did some additional testing, and it seems this PR would also allow for bumping this project's tokio dependency to 0.3. There are no compilation errors, and the example code works. |
https://github.com/jeandudey/tokio-udev/blob/master/tokio-udev/examples/usb_hotplug.rs |
@witchof0x20 did it not work with udev-rs@0.5? To merge #10 first and then merge the tokio update code (when done). |
It works with udev-rs@0.5, I just split it up because that one is an easy merge, while this is a bit more complicated. |
Bump udev from 0.4 to 0.5
This reverts commit d063719.
Getting back to this, as I'm more free now. As I understand it, I would modify Then, |
I think I got this working with Requesting review from @jeandudey |
Thanks for your contribution! Will add the changes to the CHANGELOG.md and release a new version as soon as possible. |
Released |
This is my attempt at updating to mio 0.7, as referenced in #6
This is likely not entirely correct, and I plan to go back over it some time this week. Putting it up as a PR to make it easier to see changes.