STINNER Victor <[email protected]> added the comment:
Yury Selivanov told me that usually it's safer to add call_soon(), than to
remove call_soon(). But adding many call_soon() can make asyncio SSL slower.
SSLProtocol doesn't seem to like call_soon(), it's only used at:
* connection_lost(): call_soon(self._app_protocol.connection_lost, exc)
* connection_made() ~~> call_soon(self._process_write_backlog)
* _on_handshake_complete(): call_soon(self._process_write_backlog)
That's all. All other operations are done immediately.
_on_handshake_complete() contains a long comment:
# In case transport.write() was already called. Don't call
# immediately _process_write_backlog(), but schedule it:
# _on_handshake_complete() can be called indirectly from
# _process_write_backlog(), and _process_write_backlog() is not
# reentrant.
self._loop.call_soon(self._process_write_backlog)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com