(self, sock, data)
| 232 | conn_event_task.cancel() |
| 233 | |
| 234 | async def _write(self, sock, data): |
| 235 | write_task = asyncio.ensure_future( |
| 236 | self.loop.sock_sendall(sock, data)) |
| 237 | conn_event_task = asyncio.ensure_future( |
| 238 | self.connectivity_loss.wait()) |
| 239 | |
| 240 | try: |
| 241 | await asyncio.wait( |
| 242 | [write_task, conn_event_task], |
| 243 | return_when=asyncio.FIRST_COMPLETED) |
| 244 | |
| 245 | if self.connectivity_loss.is_set(): |
| 246 | return None |
| 247 | else: |
| 248 | return write_task.result() |
| 249 | finally: |
| 250 | if not self.loop.is_closed(): |
| 251 | if not write_task.done(): |
| 252 | write_task.cancel() |
| 253 | if not conn_event_task.done(): |
| 254 | conn_event_task.cancel() |
| 255 | |
| 256 | async def proxy_to_backend(self): |
| 257 | buf = None |
no test coverage detected