Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Clarify docs
  • Loading branch information
Yury Selivanov
Yury Selivanov committed May 28, 2018
commit d749582eb3a0c9afb48903ca1e4af12c7e5a1deb
9 changes: 5 additions & 4 deletions Doc/library/asyncio-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ The idea of BufferedProtocol is that it allows to manually allocate
and control the receive buffer. Event loops can then use the buffer
provided by the protocol to avoid unnecessary data copies. This
can result in noticeable performance improvement for protocols that
receive big amounts of data. Sophisticated protocols can allocate
the buffer only once at creation time.
receive big amounts of data. Sophisticated protocols implementations
can allocate the buffer only once at creation time.

The following callbacks are called on :class:`BufferedProtocol`
instances:
Expand All @@ -474,11 +474,12 @@ instances:
Called to allocate a new receive buffer.

*sizehint* is a recommended minimal size for the returned
buffer. When set to -1, the buffer size can be arbitrary.
buffer. It is acceptable to return smaller or bigger buffers
than what *sizehint* suggests. When set to -1, the buffer size
can be arbitrary. It is an error to return a zero-sized buffer.

Must return an object that implements the
:ref:`buffer protocol <bufferobjects>`.
It is an error to return a zero-sized buffer.

.. method:: BufferedProtocol.buffer_updated(nbytes)

Expand Down