mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
asyncio: sync with Tulip
* Tulip issue #183: log socket events in debug mode - Log most important socket events: socket connected, new client, connection reset or closed by peer (EOF), etc. - Log time elapsed in DNS resolution (getaddrinfo) - Log pause/resume reading - Log time of SSL handshake - Log SSL handshake errors - Add a __repr__() method to many classes * Fix ProactorEventLoop() in debug mode. ProactorEventLoop._make_self_pipe() doesn't call call_soon() directly because it checks for the current loop which fails, because the method is called to build the event loop. * Cleanup _ProactorReadPipeTransport constructor. Not need to set again _read_fut attribute to None, it is already done in the base class.
This commit is contained in:
parent
8ebeb03740
commit
e912e652f8
7 changed files with 219 additions and 29 deletions
|
@ -40,6 +40,18 @@ class _OverlappedFuture(futures.Future):
|
|||
super().__init__(loop=loop)
|
||||
self.ov = ov
|
||||
|
||||
def __repr__(self):
|
||||
info = [self._state.lower()]
|
||||
if self.ov.pending:
|
||||
info.append('overlapped=pending')
|
||||
else:
|
||||
info.append('overlapped=completed')
|
||||
if self._state == futures._FINISHED:
|
||||
info.append(self._format_result())
|
||||
if self._callbacks:
|
||||
info.append(self._format_callbacks())
|
||||
return '<%s %s>' % (self.__class__.__name__, ' '.join(info))
|
||||
|
||||
def cancel(self):
|
||||
try:
|
||||
self.ov.cancel()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue