Fix use of blocking wait() that can stall the runtime. #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, the client could sometimes hang at the
wait()
, because thewait()
had blocked the same runtime that was trying to make progress on the connect future. The original code had this cryptic comment:hyperlocal/src/client/mod.rs
Line 55 in d9c4dfb
I assume it was done that way because it could not have used a
Future::map()
combinator on theUnixStream::connect()
future while also keeping theFutureResult
return type.This change makes it use a custom
Future
impl instead of blocking the runtime.cc @dylanmckay