Before this change, the client could sometimes hang at the wait(), because the wait() had blocked the same runtime that was trying to make progress on the connect future. The original code had this cryptic comment:
I assume it was done that way because it could not have used a Future::map() combinator on the UnixStream::connect() future while also keeping the FutureResult return type.
This change makes it use a custom Future impl instead of blocking the runtime.
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:https://github.com/softprops/hyperlocal/blob/d9c4dfba855bc0f582b48a0512615396dffe7dd4/src/client/mod.rs#L55
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