14 """Utilities for RPC Framework's Face interface."""
26 collections.namedtuple(
'_MethodImplementation', [
30 'unary_stream_inline',
31 'stream_unary_inline',
32 'stream_stream_inline',
36 'stream_stream_event',
42 """Creates an face.MethodImplementation for the given behavior.
45 behavior: The implementation of a unary-unary RPC method as a callable value
46 that takes a request value and an face.ServicerContext object and
47 returns a response value.
50 An face.MethodImplementation derived from the given behavior.
53 style.Service.INLINE, behavior,
None,
None,
54 None,
None,
None,
None,
None)
58 """Creates an face.MethodImplementation for the given behavior.
61 behavior: The implementation of a unary-stream RPC method as a callable
62 value that takes a request value and an face.ServicerContext object and
63 returns an iterator of response values.
66 An face.MethodImplementation derived from the given behavior.
69 style.Service.INLINE,
None, behavior,
None,
70 None,
None,
None,
None,
None)
74 """Creates an face.MethodImplementation for the given behavior.
77 behavior: The implementation of a stream-unary RPC method as a callable
78 value that takes an iterator of request values and an
79 face.ServicerContext object and returns a response value.
82 An face.MethodImplementation derived from the given behavior.
85 style.Service.INLINE,
None,
None, behavior,
86 None,
None,
None,
None,
None)
90 """Creates an face.MethodImplementation for the given behavior.
93 behavior: The implementation of a stream-stream RPC method as a callable
94 value that takes an iterator of request values and an
95 face.ServicerContext object and returns an iterator of response values.
98 An face.MethodImplementation derived from the given behavior.
101 style.Service.INLINE,
None,
None,
None,
102 behavior,
None,
None,
None,
None)
106 """Creates an face.MethodImplementation for the given behavior.
109 behavior: The implementation of a unary-unary RPC method as a callable
110 value that takes a request value, a response callback to which to pass
111 the response value of the RPC, and an face.ServicerContext.
114 An face.MethodImplementation derived from the given behavior.
117 style.Service.EVENT,
None,
None,
None,
None,
118 behavior,
None,
None,
None)
122 """Creates an face.MethodImplementation for the given behavior.
125 behavior: The implementation of a unary-stream RPC method as a callable
126 value that takes a request value, a stream.Consumer to which to pass the
127 the response values of the RPC, and an face.ServicerContext.
130 An face.MethodImplementation derived from the given behavior.
133 style.Service.EVENT,
None,
None,
None,
None,
134 None, behavior,
None,
None)
138 """Creates an face.MethodImplementation for the given behavior.
141 behavior: The implementation of a stream-unary RPC method as a callable
142 value that takes a response callback to which to pass the response value
143 of the RPC and an face.ServicerContext and returns a stream.Consumer to
144 which the request values of the RPC should be passed.
147 An face.MethodImplementation derived from the given behavior.
150 style.Service.EVENT,
None,
None,
None,
None,
151 None,
None, behavior,
None)
155 """Creates an face.MethodImplementation for the given behavior.
158 behavior: The implementation of a stream-stream RPC method as a callable
159 value that takes a stream.Consumer to which to pass the response values
160 of the RPC and an face.ServicerContext and returns a stream.Consumer to
161 which the request values of the RPC should be passed.
164 An face.MethodImplementation derived from the given behavior.
167 style.Service.EVENT,
None,
None,
None,
None,
168 None,
None,
None, behavior)