Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Queue write only after processing all buffers #445

Merged
merged 6 commits into from
Sep 9, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion uvloop/handles/stream.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# MIT and Apache 2.0
#
# Copyright (c) 2021, NVIDIA CORPORATION.


DEF __PREALLOCED_BUFS = 4


Expand Down Expand Up @@ -446,7 +451,6 @@ cdef class UVStream(UVBaseTransport):
return

self._maybe_pause_protocol()
self._loop._queue_write(self)

cdef inline _exec_write(self):
cdef:
Expand Down Expand Up @@ -680,6 +684,7 @@ cdef class UVStream(UVBaseTransport):
self._conn_lost += 1
return
self._write(buf)
self._loop._queue_write(self)

def writelines(self, bufs):
self._ensure_alive()
Expand All @@ -691,6 +696,7 @@ cdef class UVStream(UVBaseTransport):
return
for buf in bufs:
self._write(buf)
self._loop._queue_write(self)

def write_eof(self):
self._ensure_alive()
Expand Down