14 """Utilities for use with the base interface of RPC Framework."""
22 collections.namedtuple(
'_Completion', (
27 """A trivial implementation of base.Completion."""
31 collections.namedtuple(
'_Subscription', (
33 'termination_callback',
38 """A trivial implementation of base.Subscription."""
41 _NONE_SUBSCRIPTION =
_Subscription(base.Subscription.Kind.NONE,
None,
None,
46 """Creates a base.Completion aggregating the given operation values.
49 terminal_metadata: A terminal metadata value for an operaton.
50 code: A code value for an operation.
51 message: A message value for an operation.
54 A base.Completion aggregating the given operation values.
56 return _Completion(terminal_metadata, code, message)
60 """Creates a "full" base.Subscription for the given base.Operator.
63 operator: A base.Operator to be used in an operation.
64 protocol_receiver: A base.ProtocolReceiver to be used in an operation.
67 A base.Subscription of kind base.Subscription.Kind.FULL wrapping the given
68 base.Operator and base.ProtocolReceiver.
70 return _Subscription(base.Subscription.Kind.FULL,
None,
None, operator,