_channel_rpc.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_testing
16 
17 
19 
20  def __init__(self, rpc_state):
21  self._rpc_state = rpc_state
22 
23  def send_initial_metadata(self, initial_metadata):
24  self._rpc_state.send_initial_metadata(initial_metadata)
25 
26  def cancelled(self):
27  self._rpc_state.cancelled()
28 
29  def terminate(self, response, trailing_metadata, code, details):
30  self._rpc_state.terminate_with_response(response, trailing_metadata,
31  code, details)
32 
33 
35 
36  def __init__(self, rpc_state):
37  self._rpc_state = rpc_state
38 
39  def send_initial_metadata(self, initial_metadata):
40  self._rpc_state.send_initial_metadata(initial_metadata)
41 
42  def send_response(self, response):
43  self._rpc_state.send_response(response)
44 
45  def cancelled(self):
46  self._rpc_state.cancelled()
47 
48  def terminate(self, trailing_metadata, code, details):
49  self._rpc_state.terminate(trailing_metadata, code, details)
50 
51 
53 
54  def __init__(self, rpc_state):
55  self._rpc_state = rpc_state
56 
57  def send_initial_metadata(self, initial_metadata):
58  self._rpc_state.send_initial_metadata(initial_metadata)
59 
60  def take_request(self):
61  return self._rpc_state.take_request()
62 
63  def requests_closed(self):
64  return self._rpc_state.requests_closed()
65 
66  def cancelled(self):
67  self._rpc_state.cancelled()
68 
69  def terminate(self, response, trailing_metadata, code, details):
70  self._rpc_state.terminate_with_response(response, trailing_metadata,
71  code, details)
72 
73 
75 
76  def __init__(self, rpc_state):
77  self._rpc_state = rpc_state
78 
79  def send_initial_metadata(self, initial_metadata):
80  self._rpc_state.send_initial_metadata(initial_metadata)
81 
82  def take_request(self):
83  return self._rpc_state.take_request()
84 
85  def send_response(self, response):
86  self._rpc_state.send_response(response)
87 
88  def requests_closed(self):
89  return self._rpc_state.requests_closed()
90 
91  def cancelled(self):
92  self._rpc_state.cancelled()
93 
94  def terminate(self, trailing_metadata, code, details):
95  self._rpc_state.terminate(trailing_metadata, code, details)
96 
97 
98 def unary_unary(channel_state, method_descriptor):
99  rpc_state = channel_state.take_rpc_state(method_descriptor)
100  invocation_metadata, request = (
101  rpc_state.take_invocation_metadata_and_request())
102  return invocation_metadata, request, _UnaryUnary(rpc_state)
103 
104 
105 def unary_stream(channel_state, method_descriptor):
106  rpc_state = channel_state.take_rpc_state(method_descriptor)
107  invocation_metadata, request = (
108  rpc_state.take_invocation_metadata_and_request())
109  return invocation_metadata, request, _UnaryStream(rpc_state)
110 
111 
112 def stream_unary(channel_state, method_descriptor):
113  rpc_state = channel_state.take_rpc_state(method_descriptor)
114  return rpc_state.take_invocation_metadata(), _StreamUnary(rpc_state)
115 
116 
117 def stream_stream(channel_state, method_descriptor):
118  rpc_state = channel_state.take_rpc_state(method_descriptor)
119  return rpc_state.take_invocation_metadata(), _StreamStream(rpc_state)
grpc_testing._channel._channel_rpc._StreamStream.send_initial_metadata
def send_initial_metadata(self, initial_metadata)
Definition: _channel_rpc.py:79
grpc_testing._channel._channel_rpc._StreamUnary.requests_closed
def requests_closed(self)
Definition: _channel_rpc.py:63
grpc_testing._channel._channel_rpc._StreamStream._rpc_state
_rpc_state
Definition: _channel_rpc.py:77
grpc_testing._channel._channel_rpc._StreamUnary
Definition: _channel_rpc.py:52
grpc_testing.StreamStreamChannelRpc
Definition: src/python/grpcio_testing/grpc_testing/__init__.py:153
grpc_testing._channel._channel_rpc._StreamUnary.__init__
def __init__(self, rpc_state)
Definition: _channel_rpc.py:54
grpc_testing.UnaryUnaryChannelRpc
Definition: src/python/grpcio_testing/grpc_testing/__init__.py:23
grpc_testing._channel._channel_rpc.stream_unary
def stream_unary(channel_state, method_descriptor)
Definition: _channel_rpc.py:112
grpc_testing._channel._channel_rpc._StreamStream.take_request
def take_request(self)
Definition: _channel_rpc.py:82
grpc_testing._channel._channel_rpc._StreamStream.send_response
def send_response(self, response)
Definition: _channel_rpc.py:85
grpc_testing._channel._channel_rpc._UnaryUnary._rpc_state
_rpc_state
Definition: _channel_rpc.py:21
grpc_testing._channel._channel_rpc._UnaryStream.terminate
def terminate(self, trailing_metadata, code, details)
Definition: _channel_rpc.py:48
grpc_testing.StreamUnaryChannelRpc
Definition: src/python/grpcio_testing/grpc_testing/__init__.py:99
grpc_testing._channel._channel_rpc._UnaryStream.send_response
def send_response(self, response)
Definition: _channel_rpc.py:42
grpc_testing._channel._channel_rpc.unary_stream
def unary_stream(channel_state, method_descriptor)
Definition: _channel_rpc.py:105
grpc_testing._channel._channel_rpc._UnaryStream.cancelled
def cancelled(self)
Definition: _channel_rpc.py:45
grpc_testing._channel._channel_rpc._UnaryUnary.__init__
def __init__(self, rpc_state)
Definition: _channel_rpc.py:20
grpc_testing._channel._channel_rpc._StreamStream.__init__
def __init__(self, rpc_state)
Definition: _channel_rpc.py:76
grpc_testing.UnaryStreamChannelRpc
Definition: src/python/grpcio_testing/grpc_testing/__init__.py:57
grpc_testing._channel._channel_rpc._StreamUnary.cancelled
def cancelled(self)
Definition: _channel_rpc.py:66
grpc_testing._channel._channel_rpc._StreamStream.requests_closed
def requests_closed(self)
Definition: _channel_rpc.py:88
grpc_testing._channel._channel_rpc._UnaryStream.send_initial_metadata
def send_initial_metadata(self, initial_metadata)
Definition: _channel_rpc.py:39
grpc_testing._channel._channel_rpc._StreamUnary.send_initial_metadata
def send_initial_metadata(self, initial_metadata)
Definition: _channel_rpc.py:57
grpc_testing._channel._channel_rpc._UnaryUnary.cancelled
def cancelled(self)
Definition: _channel_rpc.py:26
grpc_testing._channel._channel_rpc._StreamUnary.take_request
def take_request(self)
Definition: _channel_rpc.py:60
grpc_testing._channel._channel_rpc._UnaryStream
Definition: _channel_rpc.py:34
grpc_testing._channel._channel_rpc._StreamStream
Definition: _channel_rpc.py:74
grpc_testing._channel._channel_rpc._UnaryUnary.terminate
def terminate(self, response, trailing_metadata, code, details)
Definition: _channel_rpc.py:29
grpc_testing._channel._channel_rpc._UnaryUnary
Definition: _channel_rpc.py:18
grpc_testing._channel._channel_rpc._StreamStream.cancelled
def cancelled(self)
Definition: _channel_rpc.py:91
grpc_testing._channel._channel_rpc._UnaryStream.__init__
def __init__(self, rpc_state)
Definition: _channel_rpc.py:36
grpc_testing._channel._channel_rpc.stream_stream
def stream_stream(channel_state, method_descriptor)
Definition: _channel_rpc.py:117
grpc_testing._channel._channel_rpc._UnaryStream._rpc_state
_rpc_state
Definition: _channel_rpc.py:37
grpc_testing._channel._channel_rpc.unary_unary
def unary_unary(channel_state, method_descriptor)
Definition: _channel_rpc.py:98
grpc_testing._channel._channel_rpc._StreamUnary._rpc_state
_rpc_state
Definition: _channel_rpc.py:55
grpc_testing._channel._channel_rpc._StreamUnary.terminate
def terminate(self, response, trailing_metadata, code, details)
Definition: _channel_rpc.py:69
grpc_testing._channel._channel_rpc._StreamStream.terminate
def terminate(self, trailing_metadata, code, details)
Definition: _channel_rpc.py:94
grpc_testing._channel._channel_rpc._UnaryUnary.send_initial_metadata
def send_initial_metadata(self, initial_metadata)
Definition: _channel_rpc.py:23


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:38