MCPcopy Index your code
hub / github.com/RustPython/RustPython / writelines

Method writelines

Lib/asyncio/selector_events.py:1170–1189  ·  view source on GitHub ↗
(self, list_of_data)

Source from the content-addressed store, hash-verified

1168 self._sock.shutdown(socket.SHUT_WR)
1169
1170 def writelines(self, list_of_data):
1171 if self._eof:
1172 raise RuntimeError('Cannot call writelines() after write_eof()')
1173 if self._empty_waiter is not None:
1174 raise RuntimeError('unable to writelines; sendfile is in progress')
1175 if not list_of_data:
1176 return
1177
1178 if self._conn_lost:
1179 if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
1180 logger.warning('socket.send() raised exception.')
1181 self._conn_lost += 1
1182 return
1183
1184 self._buffer.extend([memoryview(data) for data in list_of_data])
1185 self._write_ready()
1186 # If the entire buffer couldn't be written, register a write handler
1187 if self._buffer:
1188 self._loop._add_writer(self._sock_fd, self._write_ready)
1189 self._maybe_pause_protocol()
1190
1191 def can_write_eof(self):
1192 return True

Callers

nothing calls this directly

Calls 5

_write_readyMethod · 0.80
_maybe_pause_protocolMethod · 0.80
warningMethod · 0.45
extendMethod · 0.45
_add_writerMethod · 0.45

Tested by

no test coverage detected