Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of blocking wait() that can stall the runtime. #18

Merged
merged 1 commit into from
Sep 21, 2018
Merged

Fix use of blocking wait() that can stall the runtime. #18

merged 1 commit into from
Sep 21, 2018

Conversation

arsing
Copy link
Contributor

@arsing arsing commented Sep 21, 2018

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:

.wait() // We have to block because we

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.

cc @dylanmckay

Copy link
Owner

@softprops softprops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@softprops softprops merged commit 3836773 into softprops:master Sep 21, 2018
@softprops
Copy link
Owner

@arsing these changes where published in 0.6.0

@dylanmckay
Copy link
Contributor

This is good @arsing , thanks for catching and fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants