@ -14,7 +14,7 @@
""" Abstract base classes for Channel objects and Multicallable objects. """
import abc
from typing import Any , Optional
from typing import Generic , Optional
import grpc
@ -22,23 +22,25 @@ from . import _base_call
from . _typing import DeserializingFunction
from . _typing import MetadataType
from . _typing import RequestIterableType
from . _typing import RequestType
from . _typing import ResponseType
from . _typing import SerializingFunction
class UnaryUnaryMultiCallable ( abc . ABC ) :
class UnaryUnaryMultiCallable ( Generic [ RequestType , ResponseType ] , abc . ABC ) :
""" Enables asynchronous invocation of a unary-call RPC. """
@abc . abstractmethod
def __call__ (
self ,
request : Any ,
request : RequestType ,
* ,
timeout : Optional [ float ] = None ,
metadata : Optional [ MetadataType ] = None ,
credentials : Optional [ grpc . CallCredentials ] = None ,
wait_for_ready : Optional [ bool ] = None ,
compression : Optional [ grpc . Compression ] = None
) - > _base_call . UnaryUnaryCall :
) - > _base_call . UnaryUnaryCall [ RequestType , ResponseType ] :
""" Asynchronously invokes the underlying RPC.
Args :
@ -63,20 +65,20 @@ class UnaryUnaryMultiCallable(abc.ABC):
"""
class UnaryStreamMultiCallable ( abc . ABC ) :
class UnaryStreamMultiCallable ( Generic [ RequestType , ResponseType ] , abc . ABC ) :
""" Enables asynchronous invocation of a server-streaming RPC. """
@abc . abstractmethod
def __call__ (
self ,
request : Any ,
request : RequestType ,
* ,
timeout : Optional [ float ] = None ,
metadata : Optional [ MetadataType ] = None ,
credentials : Optional [ grpc . CallCredentials ] = None ,
wait_for_ready : Optional [ bool ] = None ,
compression : Optional [ grpc . Compression ] = None
) - > _base_call . UnaryStreamCall :
) - > _base_call . UnaryStreamCall [ RequestType , ResponseType ] :
""" Asynchronously invokes the underlying RPC.
Args :