summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/streams.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/streams.py')
-rw-r--r--Lib/asyncio/streams.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index 9b654cd..d18db77 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -15,6 +15,7 @@ from . import events
from . import futures
from . import protocols
from .coroutines import coroutine
+from .log import logger
_DEFAULT_LIMIT = 2**16
@@ -153,10 +154,15 @@ class FlowControlMixin(protocols.Protocol):
def pause_writing(self):
assert not self._paused
self._paused = True
+ if self._loop.get_debug():
+ logger.debug("%r pauses writing", self)
def resume_writing(self):
assert self._paused
self._paused = False
+ if self._loop.get_debug():
+ logger.debug("%r resumes writing", self)
+
waiter = self._drain_waiter
if waiter is not None:
self._drain_waiter = None
@@ -244,6 +250,12 @@ class StreamWriter:
self._reader = reader
self._loop = loop
+ def __repr__(self):
+ info = [self.__class__.__name__, 'transport=%r' % self._transport]
+ if self._reader is not None:
+ info.append('reader=%r' % self._reader)
+ return '<%s>' % ' '.join(info)
+
@property
def transport(self):
return self._transport