예제 #1
0
파일: session.py 프로젝트: fr3aker/aiorpcX
 async def __aexit__(self, exc_type, exc_value, traceback):
     if exc_type is None:
         self.batch = Batch(self._requests)
         message, future = self._session.connection.send_batch(self.batch)
         self.results = await self._session._send_concurrent(
             message, future, len(self.batch))
         if self._raise_errors:
             if any(isinstance(item, Exception) for item in self.results):
                 raise BatchError(self)
예제 #2
0
파일: session.py 프로젝트: dgb256/aiorpcX
 async def __aexit__(self, exc_type, exc_value, traceback):
     if exc_type is None:
         self.batch = Batch(self._requests)
         message, event = self._session.connection.send_batch(self.batch)
         await self._session._send_message(message)
         await event.wait()
         self.results = event.result
         if self._raise_errors:
             if any(isinstance(item, Exception) for item in event.result):
                 raise BatchError(self)
예제 #3
0
 async def __aexit__(self, exc_type, exc_value, traceback):
     if exc_type is None:
         self.batch = Batch(self._requests)
         message, event = self._session.connection.send_batch(self.batch)
         await self._session._send_message(message)
         await event.wait()
         result = event.result
         # Can happen with cancel_pending_requests
         if isinstance(result, CancelledError):
             raise result
         self.results = result
         if self._raise_errors:
             if any(isinstance(item, Exception) for item in result):
                 raise BatchError(self)