Open cr8t opened 5 months ago
@kevinmehall could you provide some feedback on what would be useful for you in nusb
?
@CertainLach what would be most helpful in your use-case?
I'd recommend defaulting the socket to blocking mode so it "just works" but allow interoperating with async runtimes without requiring any one of them. Implement the std
AsFd
and AsRawFd
traits, and make sure it passes through ErrorKind::WouldBlock
results from the socket. Then users can wrap it in an async-io's Async<T>
or Tokio AsyncFd
to integrate it with their event loops.
From https://github.com/cr8t/udev/issues/15#issuecomment-1913190142:
There should be an easy way to configure the
UdevMonitor
, and otherudevrs
modules to use blocking/polling mode.What is a good design-choice for implementing a non-blocking mode that is agnostic to
async
/threading/etc.?