MCPcopy Create free account
hub / github.com/EasyIME/PIME / __init__

Method __init__

python/python3/tornado/iostream.py:227–283  ·  view source on GitHub ↗

`BaseIOStream` constructor. :arg max_buffer_size: Maximum amount of incoming data to buffer; defaults to 100MB. :arg read_chunk_size: Amount of data to read at one time from the underlying transport; defaults to 64KB. :arg max_write_buffer_size: Amoun

(
        self,
        max_buffer_size: Optional[int] = None,
        read_chunk_size: Optional[int] = None,
        max_write_buffer_size: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

225 """
226
227 def __init__(
228 self,
229 max_buffer_size: Optional[int] = None,
230 read_chunk_size: Optional[int] = None,
231 max_write_buffer_size: Optional[int] = None,
232 ) -> None:
233 """`BaseIOStream` constructor.
234
235 :arg max_buffer_size: Maximum amount of incoming data to buffer;
236 defaults to 100MB.
237 :arg read_chunk_size: Amount of data to read at one time from the
238 underlying transport; defaults to 64KB.
239 :arg max_write_buffer_size: Amount of outgoing data to buffer;
240 defaults to unlimited.
241
242 .. versionchanged:: 4.0
243 Add the ``max_write_buffer_size`` parameter. Changed default
244 ``read_chunk_size`` to 64KB.
245 .. versionchanged:: 5.0
246 The ``io_loop`` argument (deprecated since version 4.1) has been
247 removed.
248 """
249 self.io_loop = ioloop.IOLoop.current()
250 self.max_buffer_size = max_buffer_size or 104857600
251 # A chunk size that is too close to max_buffer_size can cause
252 # spurious failures.
253 self.read_chunk_size = min(read_chunk_size or 65536, self.max_buffer_size // 2)
254 self.max_write_buffer_size = max_write_buffer_size
255 self.error = None # type: Optional[BaseException]
256 self._read_buffer = bytearray()
257 self._read_buffer_pos = 0
258 self._read_buffer_size = 0
259 self._user_read_buffer = False
260 self._after_user_read_buffer = None # type: Optional[bytearray]
261 self._write_buffer = _StreamBuffer()
262 self._total_write_index = 0
263 self._total_write_done_index = 0
264 self._read_delimiter = None # type: Optional[bytes]
265 self._read_regex = None # type: Optional[Pattern]
266 self._read_max_bytes = None # type: Optional[int]
267 self._read_bytes = None # type: Optional[int]
268 self._read_partial = False
269 self._read_until_close = False
270 self._read_future = None # type: Optional[Future]
271 self._write_futures = (
272 collections.deque()
273 ) # type: Deque[Tuple[int, Future[None]]]
274 self._close_callback = None # type: Optional[Callable[[], None]]
275 self._connect_future = None # type: Optional[Future[IOStream]]
276 # _ssl_connect_future should be defined in SSLIOStream
277 # but it's here so we can clean it up in _signal_closed
278 # TODO: refactor that so subclasses can add additional futures
279 # to be cancelled.
280 self._ssl_connect_future = None # type: Optional[Future[SSLIOStream]]
281 self._connecting = False
282 self._state = None # type: Optional[int]
283 self._closed = False
284

Callers

nothing calls this directly

Calls 2

_StreamBufferClass · 0.85
currentMethod · 0.80

Tested by

no test coverage detected