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

Polish docs and ABC, convert everything except multipart and client to async/await syntax #2483

Merged
merged 12 commits into from
Nov 9, 2017

Conversation

asvetlov
Copy link
Member

@asvetlov asvetlov commented Nov 8, 2017

  • Make AbstractPayloadWriter.write() an async function
  • Drop response.drain() from docs

The drain is still supported but removed from documentation: users should call await resp.write().
write() calls writer's drain() behind the scene.

@asvetlov asvetlov added the web label Nov 8, 2017
@codecov-io
Copy link

codecov-io commented Nov 8, 2017

Codecov Report

Merging #2483 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2483      +/-   ##
==========================================
- Coverage   97.15%   97.14%   -0.02%     
==========================================
  Files          39       39              
  Lines        8097     8099       +2     
  Branches     1416     1416              
==========================================
+ Hits         7867     7868       +1     
  Misses         99       99              
- Partials      131      132       +1
Impacted Files Coverage Δ
aiohttp/http_writer.py 94.44% <ø> (ø) ⬆️
aiohttp/abc.py 100% <ø> (ø) ⬆️
aiohttp/test_utils.py 98.22% <100%> (-0.36%) ⬇️
aiohttp/web_response.py 98.19% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8fd679f...428b368. Read the comment docs.

@@ -408,6 +408,9 @@ def write(self, data):
assert not self._eof_sent, "EOF has already been sent"
assert self._payload_writer is not None, \
"Response has not been started"
warnings.warn("drain method is deprecated, use await resp.write()",
Copy link
Member

Choose a reason for hiding this comment

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

write method should be changed to async. Otherwise this suggestion will lead to errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please elaborate

Copy link
Member

Choose a reason for hiding this comment

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

StreamResponse.write is not async now. What it returns is a mystery. According the interface StreamResponse.write breaks it. So it would be fine to expect strange things including TypeErrors on trying to await non-coroutine value.

Copy link
Member Author

Choose a reason for hiding this comment

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

write is async now.

@asvetlov
Copy link
Member Author

asvetlov commented Nov 9, 2017

@kxepal please review again.
I believe the PR is done and ready for merging.

@asvetlov asvetlov changed the title Polish docs and ABC Polish docs and ABC, convert everything except multipart and client to async/await syntax Nov 9, 2017
@asvetlov asvetlov merged commit 53edaa6 into master Nov 9, 2017
@asvetlov asvetlov deleted the polishing branch November 9, 2017 18:25
@asvetlov
Copy link
Member Author

asvetlov commented Nov 9, 2017

@kxepal thanks!

@asvetlov
Copy link
Member Author

asvetlov commented Nov 9, 2017

@kxepal say again I very appreciate your reviews.
Please keep it going.

@kxepal
Copy link
Member

kxepal commented Nov 9, 2017

@asvetlov you're welcome! Glad to help how I can (:

kxepal added a commit to kxepal/aiohttp that referenced this pull request Feb 26, 2018
kxepal added a commit that referenced this pull request Feb 27, 2018
@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants