[issue34634] New asyncio streams API

2019-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Merge StreamWriter and StreamReader into just asyncio.Stream

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34634] New asyncio streams API

2019-09-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Yes, please do

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34634] New asyncio streams API

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Streams API is implemented as part of issue36889 in 3.8. I think we can close 
this as a duplicate. Thanks.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34634] New asyncio streams API

2018-09-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +8621
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34634] New asyncio streams API

2018-09-11 Thread Andrew Svetlov


New submission from Andrew Svetlov :

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.

--
messages: 325064
nosy: asvetlov
priority: normal
severity: normal
status: open
title: New asyncio streams API

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com