소스 검색

fix: cast call_protobuf_handler to async iterator if needed

Denis Mazur 4 년 전
부모
커밋
463fba90f4
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      hivemind/p2p/p2p_daemon.py

+ 1 - 0
hivemind/p2p/p2p_daemon.py

@@ -459,6 +459,7 @@ class P2P:
         if not (isinstance(input, AsyncIterableABC) or stream_output):
             return await self._call_unary_protobuf_handler(peer_id, name, input, output_protobuf_type)
 
+        requests = input if isinstance(input, AsyncIterableABC) else aiter(input)
         responses = self._iterate_protobuf_stream_handler(peer_id, name, input, output_protobuf_type)
 
         count = 0