grpcio-fips 1.70.0__4-cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. grpc/__init__.py +2348 -0
  2. grpc/_auth.py +80 -0
  3. grpc/_channel.py +2267 -0
  4. grpc/_common.py +183 -0
  5. grpc/_compression.py +71 -0
  6. grpc/_cython/__init__.py +13 -0
  7. grpc/_cython/_credentials/roots.pem +4337 -0
  8. grpc/_cython/_cygrpc/__init__.py +13 -0
  9. grpc/_cython/cygrpc.cp313-win_amd64.pyd +0 -0
  10. grpc/_grpcio_metadata.py +1 -0
  11. grpc/_interceptor.py +813 -0
  12. grpc/_observability.py +299 -0
  13. grpc/_plugin_wrapping.py +136 -0
  14. grpc/_runtime_protos.py +165 -0
  15. grpc/_server.py +1528 -0
  16. grpc/_simple_stubs.py +588 -0
  17. grpc/_typing.py +95 -0
  18. grpc/_utilities.py +222 -0
  19. grpc/aio/__init__.py +95 -0
  20. grpc/aio/_base_call.py +257 -0
  21. grpc/aio/_base_channel.py +364 -0
  22. grpc/aio/_base_server.py +385 -0
  23. grpc/aio/_call.py +764 -0
  24. grpc/aio/_channel.py +627 -0
  25. grpc/aio/_interceptor.py +1178 -0
  26. grpc/aio/_metadata.py +137 -0
  27. grpc/aio/_server.py +239 -0
  28. grpc/aio/_typing.py +43 -0
  29. grpc/aio/_utils.py +22 -0
  30. grpc/beta/__init__.py +13 -0
  31. grpc/beta/_client_adaptations.py +1015 -0
  32. grpc/beta/_metadata.py +56 -0
  33. grpc/beta/_server_adaptations.py +465 -0
  34. grpc/beta/implementations.py +345 -0
  35. grpc/beta/interfaces.py +163 -0
  36. grpc/beta/utilities.py +153 -0
  37. grpc/experimental/__init__.py +134 -0
  38. grpc/experimental/aio/__init__.py +16 -0
  39. grpc/experimental/gevent.py +27 -0
  40. grpc/experimental/session_cache.py +45 -0
  41. grpc/framework/__init__.py +13 -0
  42. grpc/framework/common/__init__.py +13 -0
  43. grpc/framework/common/cardinality.py +26 -0
  44. grpc/framework/common/style.py +24 -0
  45. grpc/framework/foundation/__init__.py +13 -0
  46. grpc/framework/foundation/abandonment.py +22 -0
  47. grpc/framework/foundation/callable_util.py +98 -0
  48. grpc/framework/foundation/future.py +219 -0
  49. grpc/framework/foundation/logging_pool.py +72 -0
  50. grpc/framework/foundation/stream.py +43 -0
  51. grpc/framework/foundation/stream_util.py +148 -0
  52. grpc/framework/interfaces/__init__.py +13 -0
  53. grpc/framework/interfaces/base/__init__.py +13 -0
  54. grpc/framework/interfaces/base/base.py +328 -0
  55. grpc/framework/interfaces/base/utilities.py +83 -0
  56. grpc/framework/interfaces/face/__init__.py +13 -0
  57. grpc/framework/interfaces/face/face.py +1084 -0
  58. grpc/framework/interfaces/face/utilities.py +245 -0
  59. grpcio_fips-1.70.0.dist-info/METADATA +55 -0
  60. grpcio_fips-1.70.0.dist-info/RECORD +63 -0
  61. grpcio_fips-1.70.0.dist-info/WHEEL +5 -0
  62. grpcio_fips-1.70.0.dist-info/licenses/LICENSE +610 -0
  63. grpcio_fips-1.70.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,72 @@
1
+ # Copyright 2015 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
+ """A thread pool that logs exceptions raised by tasks executed within it."""
15
+
16
+ from concurrent import futures
17
+ import logging
18
+
19
+ _LOGGER = logging.getLogger(__name__)
20
+
21
+
22
+ def _wrap(behavior):
23
+ """Wraps an arbitrary callable behavior in exception-logging."""
24
+
25
+ def _wrapping(*args, **kwargs):
26
+ try:
27
+ return behavior(*args, **kwargs)
28
+ except Exception:
29
+ _LOGGER.exception(
30
+ "Unexpected exception from %s executed in logging pool!",
31
+ behavior,
32
+ )
33
+ raise
34
+
35
+ return _wrapping
36
+
37
+
38
+ class _LoggingPool(object):
39
+ """An exception-logging futures.ThreadPoolExecutor-compatible thread pool."""
40
+
41
+ def __init__(self, backing_pool):
42
+ self._backing_pool = backing_pool
43
+
44
+ def __enter__(self):
45
+ return self
46
+
47
+ def __exit__(self, exc_type, exc_val, exc_tb):
48
+ self._backing_pool.shutdown(wait=True)
49
+
50
+ def submit(self, fn, *args, **kwargs):
51
+ return self._backing_pool.submit(_wrap(fn), *args, **kwargs)
52
+
53
+ def map(self, func, *iterables, **kwargs):
54
+ return self._backing_pool.map(
55
+ _wrap(func), *iterables, timeout=kwargs.get("timeout", None)
56
+ )
57
+
58
+ def shutdown(self, wait=True):
59
+ self._backing_pool.shutdown(wait=wait)
60
+
61
+
62
+ def pool(max_workers):
63
+ """Creates a thread pool that logs exceptions raised by the tasks within it.
64
+
65
+ Args:
66
+ max_workers: The maximum number of worker threads to allow the pool.
67
+
68
+ Returns:
69
+ A futures.ThreadPoolExecutor-compatible thread pool that logs exceptions
70
+ raised by the tasks executed within it.
71
+ """
72
+ return _LoggingPool(futures.ThreadPoolExecutor(max_workers))
@@ -0,0 +1,43 @@
1
+ # Copyright 2015 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
+ """Interfaces related to streams of values or objects."""
15
+
16
+ import abc
17
+
18
+
19
+ class Consumer(abc.ABC):
20
+ """Interface for consumers of finite streams of values or objects."""
21
+
22
+ @abc.abstractmethod
23
+ def consume(self, value):
24
+ """Accepts a value.
25
+
26
+ Args:
27
+ value: Any value accepted by this Consumer.
28
+ """
29
+ raise NotImplementedError()
30
+
31
+ @abc.abstractmethod
32
+ def terminate(self):
33
+ """Indicates to this Consumer that no more values will be supplied."""
34
+ raise NotImplementedError()
35
+
36
+ @abc.abstractmethod
37
+ def consume_and_terminate(self, value):
38
+ """Supplies a value and signals that no more values will be supplied.
39
+
40
+ Args:
41
+ value: Any value accepted by this Consumer.
42
+ """
43
+ raise NotImplementedError()
@@ -0,0 +1,148 @@
1
+ # Copyright 2015 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
+ """Helpful utilities related to the stream module."""
15
+
16
+ import logging
17
+ import threading
18
+
19
+ from grpc.framework.foundation import stream
20
+
21
+ _NO_VALUE = object()
22
+ _LOGGER = logging.getLogger(__name__)
23
+
24
+
25
+ class TransformingConsumer(stream.Consumer):
26
+ """A stream.Consumer that passes a transformation of its input to another."""
27
+
28
+ def __init__(self, transformation, downstream):
29
+ self._transformation = transformation
30
+ self._downstream = downstream
31
+
32
+ def consume(self, value):
33
+ self._downstream.consume(self._transformation(value))
34
+
35
+ def terminate(self):
36
+ self._downstream.terminate()
37
+
38
+ def consume_and_terminate(self, value):
39
+ self._downstream.consume_and_terminate(self._transformation(value))
40
+
41
+
42
+ class IterableConsumer(stream.Consumer):
43
+ """A Consumer that when iterated over emits the values it has consumed."""
44
+
45
+ def __init__(self):
46
+ self._condition = threading.Condition()
47
+ self._values = []
48
+ self._active = True
49
+
50
+ def consume(self, value):
51
+ with self._condition:
52
+ if self._active:
53
+ self._values.append(value)
54
+ self._condition.notify()
55
+
56
+ def terminate(self):
57
+ with self._condition:
58
+ self._active = False
59
+ self._condition.notify()
60
+
61
+ def consume_and_terminate(self, value):
62
+ with self._condition:
63
+ if self._active:
64
+ self._values.append(value)
65
+ self._active = False
66
+ self._condition.notify()
67
+
68
+ def __iter__(self):
69
+ return self
70
+
71
+ def __next__(self):
72
+ return self.next()
73
+
74
+ def next(self):
75
+ with self._condition:
76
+ while self._active and not self._values:
77
+ self._condition.wait()
78
+ if self._values:
79
+ return self._values.pop(0)
80
+ else:
81
+ raise StopIteration()
82
+
83
+
84
+ class ThreadSwitchingConsumer(stream.Consumer):
85
+ """A Consumer decorator that affords serialization and asynchrony."""
86
+
87
+ def __init__(self, sink, pool):
88
+ self._lock = threading.Lock()
89
+ self._sink = sink
90
+ self._pool = pool
91
+ # True if self._spin has been submitted to the pool to be called once and
92
+ # that call has not yet returned, False otherwise.
93
+ self._spinning = False
94
+ self._values = []
95
+ self._active = True
96
+
97
+ def _spin(self, sink, value, terminate):
98
+ while True:
99
+ try:
100
+ if value is _NO_VALUE:
101
+ sink.terminate()
102
+ elif terminate:
103
+ sink.consume_and_terminate(value)
104
+ else:
105
+ sink.consume(value)
106
+ except Exception as e: # pylint:disable=broad-except
107
+ _LOGGER.exception(e)
108
+
109
+ with self._lock:
110
+ if terminate:
111
+ self._spinning = False
112
+ return
113
+ elif self._values:
114
+ value = self._values.pop(0)
115
+ terminate = not self._values and not self._active
116
+ elif not self._active:
117
+ value = _NO_VALUE
118
+ terminate = True
119
+ else:
120
+ self._spinning = False
121
+ return
122
+
123
+ def consume(self, value):
124
+ with self._lock:
125
+ if self._active:
126
+ if self._spinning:
127
+ self._values.append(value)
128
+ else:
129
+ self._pool.submit(self._spin, self._sink, value, False)
130
+ self._spinning = True
131
+
132
+ def terminate(self):
133
+ with self._lock:
134
+ if self._active:
135
+ self._active = False
136
+ if not self._spinning:
137
+ self._pool.submit(self._spin, self._sink, _NO_VALUE, True)
138
+ self._spinning = True
139
+
140
+ def consume_and_terminate(self, value):
141
+ with self._lock:
142
+ if self._active:
143
+ self._active = False
144
+ if self._spinning:
145
+ self._values.append(value)
146
+ else:
147
+ self._pool.submit(self._spin, self._sink, value, True)
148
+ self._spinning = True
@@ -0,0 +1,13 @@
1
+ # Copyright 2015 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.
@@ -0,0 +1,13 @@
1
+ # Copyright 2015 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.
@@ -0,0 +1,328 @@
1
+ # Copyright 2015 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
+ """The base interface of RPC Framework.
15
+
16
+ Implementations of this interface support the conduct of "operations":
17
+ exchanges between two distinct ends of an arbitrary number of data payloads
18
+ and metadata such as a name for the operation, initial and terminal metadata
19
+ in each direction, and flow control. These operations may be used for transfers
20
+ of data, remote procedure calls, status indication, or anything else
21
+ applications choose.
22
+ """
23
+
24
+ # threading is referenced from specification in this module.
25
+ import abc
26
+ import enum
27
+ import threading # pylint: disable=unused-import
28
+
29
+ # pylint: disable=too-many-arguments
30
+
31
+
32
+ class NoSuchMethodError(Exception):
33
+ """Indicates that an unrecognized operation has been called.
34
+
35
+ Attributes:
36
+ code: A code value to communicate to the other side of the operation
37
+ along with indication of operation termination. May be None.
38
+ details: A details value to communicate to the other side of the
39
+ operation along with indication of operation termination. May be None.
40
+ """
41
+
42
+ def __init__(self, code, details):
43
+ """Constructor.
44
+
45
+ Args:
46
+ code: A code value to communicate to the other side of the operation
47
+ along with indication of operation termination. May be None.
48
+ details: A details value to communicate to the other side of the
49
+ operation along with indication of operation termination. May be None.
50
+ """
51
+ super(NoSuchMethodError, self).__init__()
52
+ self.code = code
53
+ self.details = details
54
+
55
+
56
+ class Outcome(object):
57
+ """The outcome of an operation.
58
+
59
+ Attributes:
60
+ kind: A Kind value coarsely identifying how the operation terminated.
61
+ code: An application-specific code value or None if no such value was
62
+ provided.
63
+ details: An application-specific details value or None if no such value was
64
+ provided.
65
+ """
66
+
67
+ @enum.unique
68
+ class Kind(enum.Enum):
69
+ """Ways in which an operation can terminate."""
70
+
71
+ COMPLETED = "completed"
72
+ CANCELLED = "cancelled"
73
+ EXPIRED = "expired"
74
+ LOCAL_SHUTDOWN = "local shutdown"
75
+ REMOTE_SHUTDOWN = "remote shutdown"
76
+ RECEPTION_FAILURE = "reception failure"
77
+ TRANSMISSION_FAILURE = "transmission failure"
78
+ LOCAL_FAILURE = "local failure"
79
+ REMOTE_FAILURE = "remote failure"
80
+
81
+
82
+ class Completion(abc.ABC):
83
+ """An aggregate of the values exchanged upon operation completion.
84
+
85
+ Attributes:
86
+ terminal_metadata: A terminal metadata value for the operation.
87
+ code: A code value for the operation.
88
+ message: A message value for the operation.
89
+ """
90
+
91
+
92
+ class OperationContext(abc.ABC):
93
+ """Provides operation-related information and action."""
94
+
95
+ @abc.abstractmethod
96
+ def outcome(self):
97
+ """Indicates the operation's outcome (or that the operation is ongoing).
98
+
99
+ Returns:
100
+ None if the operation is still active or the Outcome value for the
101
+ operation if it has terminated.
102
+ """
103
+ raise NotImplementedError()
104
+
105
+ @abc.abstractmethod
106
+ def add_termination_callback(self, callback):
107
+ """Adds a function to be called upon operation termination.
108
+
109
+ Args:
110
+ callback: A callable to be passed an Outcome value on operation
111
+ termination.
112
+
113
+ Returns:
114
+ None if the operation has not yet terminated and the passed callback will
115
+ later be called when it does terminate, or if the operation has already
116
+ terminated an Outcome value describing the operation termination and the
117
+ passed callback will not be called as a result of this method call.
118
+ """
119
+ raise NotImplementedError()
120
+
121
+ @abc.abstractmethod
122
+ def time_remaining(self):
123
+ """Describes the length of allowed time remaining for the operation.
124
+
125
+ Returns:
126
+ A nonnegative float indicating the length of allowed time in seconds
127
+ remaining for the operation to complete before it is considered to have
128
+ timed out. Zero is returned if the operation has terminated.
129
+ """
130
+ raise NotImplementedError()
131
+
132
+ @abc.abstractmethod
133
+ def cancel(self):
134
+ """Cancels the operation if the operation has not yet terminated."""
135
+ raise NotImplementedError()
136
+
137
+ @abc.abstractmethod
138
+ def fail(self, exception):
139
+ """Indicates that the operation has failed.
140
+
141
+ Args:
142
+ exception: An exception germane to the operation failure. May be None.
143
+ """
144
+ raise NotImplementedError()
145
+
146
+
147
+ class Operator(abc.ABC):
148
+ """An interface through which to participate in an operation."""
149
+
150
+ @abc.abstractmethod
151
+ def advance(
152
+ self,
153
+ initial_metadata=None,
154
+ payload=None,
155
+ completion=None,
156
+ allowance=None,
157
+ ):
158
+ """Progresses the operation.
159
+
160
+ Args:
161
+ initial_metadata: An initial metadata value. Only one may ever be
162
+ communicated in each direction for an operation, and they must be
163
+ communicated no later than either the first payload or the completion.
164
+ payload: A payload value.
165
+ completion: A Completion value. May only ever be non-None once in either
166
+ direction, and no payloads may be passed after it has been communicated.
167
+ allowance: A positive integer communicating the number of additional
168
+ payloads allowed to be passed by the remote side of the operation.
169
+ """
170
+ raise NotImplementedError()
171
+
172
+
173
+ class ProtocolReceiver(abc.ABC):
174
+ """A means of receiving protocol values during an operation."""
175
+
176
+ @abc.abstractmethod
177
+ def context(self, protocol_context):
178
+ """Accepts the protocol context object for the operation.
179
+
180
+ Args:
181
+ protocol_context: The protocol context object for the operation.
182
+ """
183
+ raise NotImplementedError()
184
+
185
+
186
+ class Subscription(abc.ABC):
187
+ """Describes customer code's interest in values from the other side.
188
+
189
+ Attributes:
190
+ kind: A Kind value describing the overall kind of this value.
191
+ termination_callback: A callable to be passed the Outcome associated with
192
+ the operation after it has terminated. Must be non-None if kind is
193
+ Kind.TERMINATION_ONLY. Must be None otherwise.
194
+ allowance: A callable behavior that accepts positive integers representing
195
+ the number of additional payloads allowed to be passed to the other side
196
+ of the operation. Must be None if kind is Kind.FULL. Must not be None
197
+ otherwise.
198
+ operator: An Operator to be passed values from the other side of the
199
+ operation. Must be non-None if kind is Kind.FULL. Must be None otherwise.
200
+ protocol_receiver: A ProtocolReceiver to be passed protocol objects as they
201
+ become available during the operation. Must be non-None if kind is
202
+ Kind.FULL.
203
+ """
204
+
205
+ @enum.unique
206
+ class Kind(enum.Enum):
207
+ NONE = "none"
208
+ TERMINATION_ONLY = "termination only"
209
+ FULL = "full"
210
+
211
+
212
+ class Servicer(abc.ABC):
213
+ """Interface for service implementations."""
214
+
215
+ @abc.abstractmethod
216
+ def service(self, group, method, context, output_operator):
217
+ """Services an operation.
218
+
219
+ Args:
220
+ group: The group identifier of the operation to be serviced.
221
+ method: The method identifier of the operation to be serviced.
222
+ context: An OperationContext object affording contextual information and
223
+ actions.
224
+ output_operator: An Operator that will accept output values of the
225
+ operation.
226
+
227
+ Returns:
228
+ A Subscription via which this object may or may not accept more values of
229
+ the operation.
230
+
231
+ Raises:
232
+ NoSuchMethodError: If this Servicer does not handle operations with the
233
+ given group and method.
234
+ abandonment.Abandoned: If the operation has been aborted and there no
235
+ longer is any reason to service the operation.
236
+ """
237
+ raise NotImplementedError()
238
+
239
+
240
+ class End(abc.ABC):
241
+ """Common type for entry-point objects on both sides of an operation."""
242
+
243
+ @abc.abstractmethod
244
+ def start(self):
245
+ """Starts this object's service of operations."""
246
+ raise NotImplementedError()
247
+
248
+ @abc.abstractmethod
249
+ def stop(self, grace):
250
+ """Stops this object's service of operations.
251
+
252
+ This object will refuse service of new operations as soon as this method is
253
+ called but operations under way at the time of the call may be given a
254
+ grace period during which they are allowed to finish.
255
+
256
+ Args:
257
+ grace: A duration of time in seconds to allow ongoing operations to
258
+ terminate before being forcefully terminated by the stopping of this
259
+ End. May be zero to terminate all ongoing operations and immediately
260
+ stop.
261
+
262
+ Returns:
263
+ A threading.Event that will be set to indicate all operations having
264
+ terminated and this End having completely stopped. The returned event
265
+ may not be set until after the full grace period (if some ongoing
266
+ operation continues for the full length of the period) or it may be set
267
+ much sooner (if for example this End had no operations in progress at
268
+ the time its stop method was called).
269
+ """
270
+ raise NotImplementedError()
271
+
272
+ @abc.abstractmethod
273
+ def operate(
274
+ self,
275
+ group,
276
+ method,
277
+ subscription,
278
+ timeout,
279
+ initial_metadata=None,
280
+ payload=None,
281
+ completion=None,
282
+ protocol_options=None,
283
+ ):
284
+ """Commences an operation.
285
+
286
+ Args:
287
+ group: The group identifier of the invoked operation.
288
+ method: The method identifier of the invoked operation.
289
+ subscription: A Subscription to which the results of the operation will be
290
+ passed.
291
+ timeout: A length of time in seconds to allow for the operation.
292
+ initial_metadata: An initial metadata value to be sent to the other side
293
+ of the operation. May be None if the initial metadata will be later
294
+ passed via the returned operator or if there will be no initial metadata
295
+ passed at all.
296
+ payload: An initial payload for the operation.
297
+ completion: A Completion value indicating the end of transmission to the
298
+ other side of the operation.
299
+ protocol_options: A value specified by the provider of a Base interface
300
+ implementation affording custom state and behavior.
301
+
302
+ Returns:
303
+ A pair of objects affording information about the operation and action
304
+ continuing the operation. The first element of the returned pair is an
305
+ OperationContext for the operation and the second element of the
306
+ returned pair is an Operator to which operation values not passed in
307
+ this call should later be passed.
308
+ """
309
+ raise NotImplementedError()
310
+
311
+ @abc.abstractmethod
312
+ def operation_stats(self):
313
+ """Reports the number of terminated operations broken down by outcome.
314
+
315
+ Returns:
316
+ A dictionary from Outcome.Kind value to an integer identifying the number
317
+ of operations that terminated with that outcome kind.
318
+ """
319
+ raise NotImplementedError()
320
+
321
+ @abc.abstractmethod
322
+ def add_idle_action(self, action):
323
+ """Adds an action to be called when this End has no ongoing operations.
324
+
325
+ Args:
326
+ action: A callable that accepts no arguments.
327
+ """
328
+ raise NotImplementedError()