Switch AsyncIterable to AsyncIterator (#31906)

pull/31927/head
Richard Belleville 2 years ago committed by GitHub
parent a5f1ac8d6a
commit 87631454fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/python/grpcio/grpc/aio/_call.py

@ -19,7 +19,7 @@ from functools import partial
import inspect
import logging
import traceback
from typing import AsyncIterable, Optional, Tuple
from typing import AsyncIterator, Optional, Tuple
import grpc
from grpc import _common
@ -294,7 +294,7 @@ class _UnaryResponseMixin(Call):
class _StreamResponseMixin(Call):
_message_aiter: AsyncIterable[ResponseType]
_message_aiter: AsyncIterator[ResponseType]
_preparation: asyncio.Task
_response_style: _APIStyle
@ -325,7 +325,7 @@ class _StreamResponseMixin(Call):
# If the read operation failed, Core should explain why.
await self._raise_for_status()
def __aiter__(self) -> AsyncIterable[ResponseType]:
def __aiter__(self) -> AsyncIterator[ResponseType]:
self._update_response_style(_APIStyle.ASYNC_GENERATOR)
if self._message_aiter is None:
self._message_aiter = self._fetch_stream_responses()

Loading…
Cancel
Save