コード例 #1
0
ファイル: test_ipc.py プロジェクト: yshvrdhn/determined
 def main(self) -> None:
     with ipc.ZMQBroadcastClient(self._pub_url,
                                 self._pull_url) as broadcast_client:
         # Start the server-client communication test.
         broadcast_client.send(ipc.ReadyMessage())
         for exp in self._exp_msgs:
             msg = broadcast_client.recv()
             assert msg == exp
             broadcast_client.send(2 * msg)
コード例 #2
0
    def __iter__(self) -> workload.Stream:
        # Signal to the CoordinatingTrialController that we are ready for workloads.
        self._broadcast_client.send(ipc.ReadyMessage())
        while True:
            obj = self._broadcast_client.recv()

            wkld, args = cast(Tuple[workload.Workload, List[Any]], obj)

            def _respond(message: Any) -> None:
                self._broadcast_client.send(message)

            yield wkld, args, _respond