This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author asvetlov
Recipients asvetlov
Date 2018-09-11.21:18:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536700682.14.0.0269046726804.issue34634@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, we have separate classes: reader and writer.

It is very inconvenient: these classes are tightly coupled internally, there is no sense to have two objects to the single logical entity.

The second problem is `writer.write()` synchronous API. To support flow control user should call `await writer.drain()` after every `writer.write()` call. But he/she can forget about drain() easy.

`writer.write()` should be softly deprecated in favor of `await writer.send()`. `writer.writelines()` is not very useful, better to merge all buffers before `await stream.send(data)` call. `writelines` should be softly deprecated as well without async replacement.

The last issue is `writer.close()` which should always be used in conjunction with `await writer.wait_closed()`. Let's return a future from `writer.close()`. The encouraged usage becomes `await writer.close()`. 
To immediate closing let's add `writer.abort()` sync function which cleans up resources without waiting for actual closing.
History
Date User Action Args
2018-09-11 21:18:02asvetlovsetrecipients: + asvetlov
2018-09-11 21:18:02asvetlovsetmessageid: <1536700682.14.0.0269046726804.issue34634@psf.upfronthosting.co.za>
2018-09-11 21:18:02asvetlovlinkissue34634 messages
2018-09-11 21:18:02asvetlovcreate