File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,6 +121,16 @@ WriteTransport
121121
122122 Return the current size of the output buffer used by the transport.
123123
124+ .. method :: get_write_buffer_limits()
125+
126+ Get the *high *- and *low *-water limits for write flow control. Return a
127+ tuple ``(low, high) `` where *low * and *high * are positive number of
128+ bytes.
129+
130+ Use :meth: `set_write_buffer_limits ` to set the limits.
131+
132+ .. versionadded :: 3.4.2
133+
124134 .. method :: set_write_buffer_limits(high=None, low=None)
125135
126136 Set the *high *- and *low *-water limits for write flow control.
@@ -141,6 +151,8 @@ WriteTransport
141151 reduces opportunities for doing I/O and computation
142152 concurrently.
143153
154+ Use :meth: `get_write_buffer_limits ` to get the limits.
155+
144156 .. method :: write(data)
145157
146158 Write some *data * bytes to the transport.
Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ def _maybe_resume_protocol(self):
273273 'protocol' : self ._protocol ,
274274 })
275275
276+ def get_write_buffer_limits (self ):
277+ return (self ._low_water , self ._high_water )
278+
276279 def _set_write_buffer_limits (self , high = None , low = None ):
277280 if high is None :
278281 if low is None :
Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ def get_write_buffer_size(self):
7979
8080 transport .set_write_buffer_limits (high = 1024 , low = 128 )
8181 self .assertFalse (transport ._protocol_paused )
82+ self .assertEqual (transport .get_write_buffer_limits (), (128 , 1024 ))
8283
8384 transport .set_write_buffer_limits (high = 256 , low = 128 )
8485 self .assertTrue (transport ._protocol_paused )
86+ self .assertEqual (transport .get_write_buffer_limits (), (128 , 256 ))
8587
8688
8789if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments