MCPcopy Index your code
hub / github.com/modelscope/modelscope / _producer

Function _producer

modelscope/utils/file_utils.py:326–337  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324 read_error = [None] # Mutable container for thread error propagation
325
326 def _producer():
327 try:
328 with open(file_path, 'rb') as f:
329 while True:
330 chunk = f.read(buffer_size)
331 if not chunk:
332 break
333 chunk_queue.put(chunk)
334 except Exception as e:
335 read_error[0] = e
336 finally:
337 chunk_queue.put(None) # Sentinel to signal EOF
338
339 reader_thread = threading.Thread(target=_producer, daemon=True)
340 reader_thread.start()

Callers

nothing calls this directly

Calls 2

putMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…