MCPcopy Index your code
hub / github.com/python/mypy / broadcast

Method broadcast

mypy/build.py:1371–1381  ·  view source on GitHub ↗

Broadcast same message to all workers in parallel.

(self, message: bytes)

Source from the content-addressed store, hash-verified

1369 return self.stats
1370
1371 def broadcast(self, message: bytes) -> None:
1372 """Broadcast same message to all workers in parallel."""
1373 t0 = time.time()
1374 threads = []
1375 for worker in self.workers:
1376 thread = Thread(target=worker.conn.write_bytes, args=(message,))
1377 thread.start()
1378 threads.append(thread)
1379 for thread in threads:
1380 thread.join()
1381 self.add_stats(broadcast_time=time.time() - t0)
1382
1383 def wait_ack(self) -> None:
1384 """Wait for an ack from all workers."""

Callers 1

process_graphFunction · 0.80

Calls 3

add_statsMethod · 0.95
appendMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected