-
-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Description
I'm not sure if it existed when aiofiles was originally written, but nowadays asyncio has StreamWriter and StreamReader base classes, and it would be more consistent with the rest of the async APIs if open() returned subclasses of these. In particular, the write method is not async, and instead drain is provided which is sync. I believe the assumption is that the StreamWriter writes to the buffer of some Transport which is the thing that is actually connected to the event loop, detects device readiness and then drains the buffer. There is an async drain method that users can manually await, but IIUC it's expected that usually the Transport is doing that for you.
Metadata
Metadata
Assignees
Labels
No labels