|
|
|
Created:
11 years, 5 months ago by haypo_gmail Modified:
11 years, 5 months ago Reviewers:
GvR Visibility:
Public. |
Convert StreamWriter.drain() to a classic coroutine
Patch Set 1 #Patch Set 2 : _make_drain_waiter() is now a coroutine and handle "connection lost" error #
Total comments: 2
Patch Set 3 : rename helper to _drain_helper() and attribute to _connection_lost #Total messages: 3
|
GvR
I think the basic idea is sound, I am just not 100% sure about the ...
|
11 years, 5 months ago (2014年07月21日 22:36:12 UTC) #1 |
I think the basic idea is sound, I am just not 100% sure about the right class structure, since this is a Mixin class. https://codereview.appspot.com/116970044/diff/20001/asyncio/streams.py File asyncio/streams.py (right): https://codereview.appspot.com/116970044/diff/20001/asyncio/streams.py#newcod... asyncio/streams.py:144: StreamWriter.drain() must wait for _make_drain_waiter() coroutine. I propose to rename _make_drain_waiter() to _drain_helper(), just so that code that was calling or overriding it will break in an obvious way. (The original text of the docstring suggests that this is a "_protected" method.) Or maybe we should just make the helper a public method introduced by this mixin class? I don't like the "_protected" convention much... https://codereview.appspot.com/116970044/diff/20001/asyncio/streams.py#newcod... asyncio/streams.py:295: This method is a coroutine. You don't have to say that, the decorator already says it.