_multi_callable.py
Go to the documentation of this file.
1 # Copyright 2017 gRPC authors.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import grpc
16 from grpc_testing import _common
17 from grpc_testing._channel import _invocation
18 
19 
20 # All per-call credentials parameters are unused by this test infrastructure.
21 # pylint: disable=unused-argument
23 
24  def __init__(self, method_full_rpc_name, channel_handler):
25  self._method_full_rpc_name = method_full_rpc_name
26  self._channel_handler = channel_handler
27 
28  def __call__(self, request, timeout=None, metadata=None, credentials=None):
29  rpc_handler = self._channel_handler.invoke_rpc(
30  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
31  [request], True, timeout)
32  return _invocation.blocking_unary_response(rpc_handler)
33 
34  def with_call(self, request, timeout=None, metadata=None, credentials=None):
35  rpc_handler = self._channel_handler.invoke_rpc(
36  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
37  [request], True, timeout)
38  return _invocation.blocking_unary_response_with_call(rpc_handler)
39 
40  def future(self, request, timeout=None, metadata=None, credentials=None):
41  rpc_handler = self._channel_handler.invoke_rpc(
42  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
43  [request], True, timeout)
44  return _invocation.future_call(rpc_handler)
45 
46 
48 
49  def __init__(self, method_full_rpc_name, channel_handler):
50  self._method_full_rpc_name = method_full_rpc_name
51  self._channel_handler = channel_handler
52 
53  def __call__(self, request, timeout=None, metadata=None, credentials=None):
54  rpc_handler = self._channel_handler.invoke_rpc(
55  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
56  [request], True, timeout)
57  return _invocation.ResponseIteratorCall(rpc_handler)
58 
59 
61 
62  def __init__(self, method_full_rpc_name, channel_handler):
63  self._method_full_rpc_name = method_full_rpc_name
64  self._channel_handler = channel_handler
65 
66  def __call__(self,
67  request_iterator,
68  timeout=None,
69  metadata=None,
70  credentials=None):
71  rpc_handler = self._channel_handler.invoke_rpc(
72  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
73  [], False, timeout)
74  _invocation.consume_requests(request_iterator, rpc_handler)
75  return _invocation.blocking_unary_response(rpc_handler)
76 
77  def with_call(self,
78  request_iterator,
79  timeout=None,
80  metadata=None,
81  credentials=None):
82  rpc_handler = self._channel_handler.invoke_rpc(
83  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
84  [], False, timeout)
85  _invocation.consume_requests(request_iterator, rpc_handler)
86  return _invocation.blocking_unary_response_with_call(rpc_handler)
87 
88  def future(self,
89  request_iterator,
90  timeout=None,
91  metadata=None,
92  credentials=None):
93  rpc_handler = self._channel_handler.invoke_rpc(
94  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
95  [], False, timeout)
96  _invocation.consume_requests(request_iterator, rpc_handler)
97  return _invocation.future_call(rpc_handler)
98 
99 
101 
102  def __init__(self, method_full_rpc_name, channel_handler):
103  self._method_full_rpc_name = method_full_rpc_name
104  self._channel_handler = channel_handler
105 
106  def __call__(self,
107  request_iterator,
108  timeout=None,
109  metadata=None,
110  credentials=None):
111  rpc_handler = self._channel_handler.invoke_rpc(
112  self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
113  [], False, timeout)
114  _invocation.consume_requests(request_iterator, rpc_handler)
115  return _invocation.ResponseIteratorCall(rpc_handler)
116 
117 
118 # pylint: enable=unused-argument
grpc_testing._channel._multi_callable.UnaryStream
Definition: _multi_callable.py:47
grpc_testing._channel._multi_callable.UnaryStream._method_full_rpc_name
_method_full_rpc_name
Definition: _multi_callable.py:50
grpc_testing._channel._multi_callable.StreamUnary.with_call
def with_call(self, request_iterator, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:77
grpc_testing._channel._multi_callable.StreamStream._channel_handler
_channel_handler
Definition: _multi_callable.py:104
grpc_testing._channel._invocation.ResponseIteratorCall
Definition: _invocation.py:288
grpc_testing._channel._multi_callable.StreamUnary
Definition: _multi_callable.py:60
grpc_testing._channel._multi_callable.UnaryUnary.with_call
def with_call(self, request, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:34
grpc_testing._channel._multi_callable.StreamUnary.__call__
def __call__(self, request_iterator, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:66
grpc_testing._channel._multi_callable.UnaryStream._channel_handler
_channel_handler
Definition: _multi_callable.py:51
grpc_testing._channel._multi_callable.StreamStream.__init__
def __init__(self, method_full_rpc_name, channel_handler)
Definition: _multi_callable.py:102
grpc_testing._channel._multi_callable.UnaryUnary._channel_handler
_channel_handler
Definition: _multi_callable.py:26
grpc_testing._channel._multi_callable.UnaryUnary.__init__
def __init__(self, method_full_rpc_name, channel_handler)
Definition: _multi_callable.py:24
grpc_testing._channel._multi_callable.UnaryStream.__init__
def __init__(self, method_full_rpc_name, channel_handler)
Definition: _multi_callable.py:49
grpc_testing._channel._multi_callable.UnaryUnary._method_full_rpc_name
_method_full_rpc_name
Definition: _multi_callable.py:25
grpc.UnaryUnaryMultiCallable
Definition: src/python/grpcio/grpc/__init__.py:663
grpc_testing._channel._multi_callable.UnaryUnary.future
def future(self, request, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:40
grpc_testing._channel._multi_callable.StreamUnary.future
def future(self, request_iterator, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:88
grpc_testing._channel._multi_callable.StreamStream
Definition: _multi_callable.py:100
grpc_testing._channel._multi_callable.UnaryStream.__call__
def __call__(self, request, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:53
grpc_testing._channel._multi_callable.StreamUnary.__init__
def __init__(self, method_full_rpc_name, channel_handler)
Definition: _multi_callable.py:62
grpc_testing._channel._multi_callable.StreamStream._method_full_rpc_name
_method_full_rpc_name
Definition: _multi_callable.py:103
grpc_testing._channel._multi_callable.StreamUnary._channel_handler
_channel_handler
Definition: _multi_callable.py:64
grpc_testing._channel._multi_callable.UnaryUnary.__call__
def __call__(self, request, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:28
grpc.StreamUnaryMultiCallable
Definition: src/python/grpcio/grpc/__init__.py:800
grpc_testing._channel._multi_callable.UnaryUnary
Definition: _multi_callable.py:22
grpc_testing._channel._multi_callable.StreamUnary._method_full_rpc_name
_method_full_rpc_name
Definition: _multi_callable.py:63
grpc_testing._channel._multi_callable.StreamStream.__call__
def __call__(self, request_iterator, timeout=None, metadata=None, credentials=None)
Definition: _multi_callable.py:106
grpc_testing._channel
Definition: src/python/grpcio_testing/grpc_testing/_channel/__init__.py:1
grpc.StreamStreamMultiCallable
Definition: src/python/grpcio/grpc/__init__.py:904


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:27