-
Notifications
You must be signed in to change notification settings - Fork 22
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
Blue/minimal http proxy #656
Conversation
+ differentiate response to show which node executed the request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the logic of this example, but I think the implementation could be improved quite a lot.
The general remark is that I would move as much of the instance-only logic as possible to HttpService
class.
print(instances()) | ||
try: | ||
await asyncio.sleep(10) | ||
except (KeyboardInterrupt, asyncio.CancelledError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we capture CancelledError
here?
I'm not saying it's wrong, I just don't understand, and this is an example - so things should be understandable : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's because the KeyboardInterrupt can happen in some other part of async code and thus, the KeyboardInterrupt won't happen in the asyncio.sleep(10)
but in some other place and that routine will have been cancelled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadeofblue
OK, that makes sense.
We have a comment "wait until Ctrl+C". I think it would be nice to add the same explanation to the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.... that's also present in all the other examples, I'm unsure if we want to pollute this one with this particular explanation
add comment to `run_local_server`
Co-authored-by: johny-b <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #652