-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Labels
feature-requestNew feature or requestNew feature or request
Description
For Rust async, it's normal for futures not to have their own timeouts. To implement a timeout you race the future with a timeout future such that the main future will be cancelled if the timeout completes first. But this requires a reactor to provide timer functionality as a generic future, and I want to make nusb not require pulling in tokio or async-std for the common case where you don't actually need async in the rest of the app.
futures_lite::future::block_on is implemented on top of parking, which has an API with a timeout. So we could see if futures_lite would add a timeout (seems like many uses of blocking on async IO would want this?), find another implementation that has this to recommend, or copy that code here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestNew feature or requestNew feature or request