|
|
|
@ -22,6 +22,7 @@ from typing import (Any, AnyStr, Callable, Dict, Iterator, Optional, Sequence, |
|
|
|
|
Tuple, TypeVar, Union) |
|
|
|
|
|
|
|
|
|
import grpc |
|
|
|
|
from grpc.experimental import experimental_api |
|
|
|
|
|
|
|
|
|
RequestType = TypeVar('RequestType') |
|
|
|
|
ResponseType = TypeVar('ResponseType') |
|
|
|
@ -169,6 +170,7 @@ class ChannelCache: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pylint: disable=too-many-arguments |
|
|
|
|
@experimental_api |
|
|
|
|
def unary_unary( |
|
|
|
|
request: RequestType, |
|
|
|
|
target: str, |
|
|
|
@ -228,7 +230,6 @@ def unary_unary( |
|
|
|
|
Returns: |
|
|
|
|
The response to the RPC. |
|
|
|
|
""" |
|
|
|
|
grpc.experimental.warn_experimental("unary_unary") |
|
|
|
|
channel = ChannelCache.get().get_channel(target, options, |
|
|
|
|
channel_credentials, compression) |
|
|
|
|
multicallable = channel.unary_unary(method, request_serializer, |
|
|
|
@ -241,6 +242,7 @@ def unary_unary( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pylint: disable=too-many-arguments |
|
|
|
|
@experimental_api |
|
|
|
|
def unary_stream( |
|
|
|
|
request: RequestType, |
|
|
|
|
target: str, |
|
|
|
@ -299,7 +301,6 @@ def unary_stream( |
|
|
|
|
Returns: |
|
|
|
|
An iterator of responses. |
|
|
|
|
""" |
|
|
|
|
grpc.experimental.warn_experimental("unary_stream") |
|
|
|
|
channel = ChannelCache.get().get_channel(target, options, |
|
|
|
|
channel_credentials, compression) |
|
|
|
|
multicallable = channel.unary_stream(method, request_serializer, |
|
|
|
@ -312,6 +313,7 @@ def unary_stream( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pylint: disable=too-many-arguments |
|
|
|
|
@experimental_api |
|
|
|
|
def stream_unary( |
|
|
|
|
request_iterator: Iterator[RequestType], |
|
|
|
|
target: str, |
|
|
|
@ -370,7 +372,6 @@ def stream_unary( |
|
|
|
|
Returns: |
|
|
|
|
The response to the RPC. |
|
|
|
|
""" |
|
|
|
|
grpc.experimental.warn_experimental("stream_unary") |
|
|
|
|
channel = ChannelCache.get().get_channel(target, options, |
|
|
|
|
channel_credentials, compression) |
|
|
|
|
multicallable = channel.stream_unary(method, request_serializer, |
|
|
|
@ -383,6 +384,7 @@ def stream_unary( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pylint: disable=too-many-arguments |
|
|
|
|
@experimental_api |
|
|
|
|
def stream_stream( |
|
|
|
|
request_iterator: Iterator[RequestType], |
|
|
|
|
target: str, |
|
|
|
@ -441,7 +443,6 @@ def stream_stream( |
|
|
|
|
Returns: |
|
|
|
|
An iterator of responses. |
|
|
|
|
""" |
|
|
|
|
grpc.experimental.warn_experimental("stream_stream") |
|
|
|
|
channel = ChannelCache.get().get_channel(target, options, |
|
|
|
|
channel_credentials, compression) |
|
|
|
|
multicallable = channel.stream_stream(method, request_serializer, |
|
|
|
|