MCPcopy
hub / github.com/encode/starlette / write

Method write

starlette/datastructures.py:451–459  ·  starlette/datastructures.py::UploadFile.write
(self, data: bytes)

Source from the content-addressed store, hash-verified

449 return bool(future_size > self._max_mem_size) if self._max_mem_size else False
450
451 async def write(self, data: bytes) -> None:
452 new_data_len = len(data)
453 if self.size is not None:
454 self.size += new_data_len
455
456 if self._will_roll(new_data_len):
457 await run_in_threadpool(self.file.write, data)
458 else:
459 self.file.write(data)
460
461 async def read(self, size: int = -1) -> bytes:
462 if self._in_memory:

Callers 7

test_uploadfile_rollingFunction · 0.95
sendMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
apply_compressionMethod · 0.45

Calls 2

_will_rollMethod · 0.95
run_in_threadpoolFunction · 0.90

Tested by 4

test_uploadfile_rollingFunction · 0.76
sendMethod · 0.36