Skip to content

Commit

Permalink
CRF: rename _start_write() to _initiate_write()
Browse files Browse the repository at this point in the history
Tweaked the comments too.

Refs #445
  • Loading branch information
fantix committed Sep 9, 2022
1 parent 9c6ecb6 commit cdab9d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions uvloop/handles/stream.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ cdef class UVStream(UVBaseTransport):
cdef inline __reading_started(self)
cdef inline __reading_stopped(self)

# The user API firstly calls _buffer_write() to buffer up user data chunks,
# potentially multiple times in writelines(), and then call _start_write()
# to start writing either immediately or in the next iteration.
# The user API write() and writelines() firstly call _buffer_write() to
# buffer up user data chunks, potentially multiple times in writelines(),
# and then call _initiate_write() to start writing either immediately or in
# the next iteration (loop._queue_write()).
cdef inline _buffer_write(self, object data)
cdef inline _start_write(self)
cdef inline _initiate_write(self)

# _exec_write() is the method that does the actual send, and _try_write()
# is a fast-path used in _exec_write() to send a single chunk.
Expand Down
6 changes: 3 additions & 3 deletions uvloop/handles/stream.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ cdef class UVStream(UVBaseTransport):
self._buffer_size += dlen
self._buffer.append(data)

cdef inline _start_write(self):
cdef inline _initiate_write(self):
if (not self._protocol_paused and
(<uv.uv_stream_t*>self._handle).write_queue_size == 0 and
self._buffer_size > self._high_water):
Expand Down Expand Up @@ -681,7 +681,7 @@ cdef class UVStream(UVBaseTransport):
self._conn_lost += 1
return
self._buffer_write(buf)
self._start_write()
self._initiate_write()

def writelines(self, bufs):
self._ensure_alive()
Expand All @@ -693,7 +693,7 @@ cdef class UVStream(UVBaseTransport):
return
for buf in bufs:
self._buffer_write(buf)
self._start_write()
self._initiate_write()

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

0 comments on commit cdab9d3

Please sign in to comment.