Giter VIP home page Giter VIP logo

tokio-udev's Introduction

tokio-udev

Non-blocking/asynchronous mio & tokio support for udev device events

Minimum Supported Rust Version

The crates are guaranteed to compile on stable Rust 1.56. It might compile with older versions but that may change in any new patch release.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

tokio-udev's People

Contributors

ids1024 avatar jeandudey avatar sjoerdsimons avatar witchof0x20 avatar xentec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tokio-udev's Issues

Re-export Enumerator

So, I'm writing a USB API, and I'd like udev::Enumerator to be exported so I can rely on just tokio-udev instead of udev.

Additionally, it'd be nice to have Enumerator wrapped in a Stream despite not being asynchronous; that way if you wanted to run code on a new device, you could chain a stream over the wrapped Enumerator and MonitorSocket.

Events were blocked while poll next

While using Tokio-udev to monitor usb disk plugin events, We found that not all the events can be polled at sametime, but until plugin/unplugin a usb disk next time.

This issuse can be easily reproduced by partition a usb disk to 4 or more partitions.

Update to mio 0.7

Mio 0.7 has been available for a while, lets wait for tokio to update from mio-0.6 to mio-0.7.

EventType not exported

It appears that EventType - necessary for using Event's event_type() - isn't imported/exported from tokio-udev or mio-udev.

Edit: not sure if this is normal practice, so my apologies if this is just noise.

Incorrect Send/Sync implementation of tokio_udev::MonitorSocket.

The Send and Sync implementation of tokio_udev::MonitorSocket is incorrect and can be used to trigger undefined behavior:

  1. Create a MonitorSocket and poll it until an Event is returned.
  2. Send the monitor to another thread and poll it until an Event is returned.
  3. On both threads, start and endless loop where you clone the returned event drop the clone again.

This results in unsynchronized calls to udev_ref and udev_unref on the same udev instance. This is not allowed by libudev and triggers undefined behavior.

In particular, no type that contains pointers to libudev objects can possibly be Send or Sync.

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.