Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Fix blocking in guessing example. #35

Closed
wants to merge 1 commit into from
Closed

Conversation

wfxr
Copy link

@wfxr wfxr commented May 18, 2019

Description

Remove await? inner the while loop which block the server from serving the next client.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

If we await inner the while loop the server will be blocked and can't serve more than one client.
@yoshuawuyts
Copy link
Collaborator

yoshuawuyts commented May 19, 2019

Thanks for this patch! -- your thinking here is sound, and we've been thinking about this too for a while! We've come up with a slightly more structural fix by using try_for_each_concurrent (#24), which can also join all errors.

In itself that's not a great API, so we've started work on #25 to make parallel loop iteration easy to do. Do you feel this would be helpful for you?

@wfxr
Copy link
Author

wfxr commented May 19, 2019

@yoshuawuyts OK. I See. Thanks for your explanation.

@yoshuawuyts
Copy link
Collaborator

@wfxr glad it was helpful; going to close this PR out in favor of #24 then (:

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

Successfully merging this pull request may close these issues.

2 participants