| # Generated by the protocol buffer compiler. DO NOT EDIT! |
| # source: streaming.proto |
| |
| import sys |
| _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) |
| from google.protobuf import descriptor as _descriptor |
| from google.protobuf import message as _message |
| from google.protobuf import reflection as _reflection |
| from google.protobuf import symbol_database as _symbol_database |
| from google.protobuf import descriptor_pb2 |
| # @@protoc_insertion_point(imports) |
| |
| _sym_db = _symbol_database.Default() |
| |
| |
| from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 |
| |
| |
| DESCRIPTOR = _descriptor.FileDescriptor( |
| name='streaming.proto', |
| package='experiment', |
| syntax='proto3', |
| serialized_pb=_b('\n\x0fstreaming.proto\x12\nexperiment\x1a\x1bgoogle/protobuf/empty.proto\"\x92\x01\n\nAsyncEvent\x12\x0b\n\x03seq\x18\x01 \x01(\x05\x12.\n\x04type\x18\x02 \x01(\x0e\x32 .experiment.AsyncEvent.EventType\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\"6\n\tEventType\x12\x0c\n\x08\x42IG_BANG\x10\x00\x12\x0e\n\nSMALL_BANG\x10\x01\x12\x0b\n\x07NO_BANG\x10\x02\")\n\x06Packet\x12\x0e\n\x06source\x18\x01 \x01(\x05\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"\"\n\x04\x45\x63ho\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\r\n\x05\x64\x65lay\x18\x02 \x01(\x02\x32\x8c\x02\n\x13\x45xperimentalService\x12-\n\x07GetEcho\x12\x10.experiment.Echo\x1a\x10.experiment.Echo\x12I\n\x15ReceiveStreamedEvents\x12\x16.google.protobuf.Empty\x1a\x16.experiment.AsyncEvent0\x01\x12>\n\x0eReceivePackets\x12\x16.google.protobuf.Empty\x1a\x12.experiment.Packet0\x01\x12;\n\x0bSendPackets\x12\x12.experiment.Packet\x1a\x16.google.protobuf.Empty(\x01\x62\x06proto3') |
| , |
| dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) |
| _sym_db.RegisterFileDescriptor(DESCRIPTOR) |
| |
| |
| |
| _ASYNCEVENT_EVENTTYPE = _descriptor.EnumDescriptor( |
| name='EventType', |
| full_name='experiment.AsyncEvent.EventType', |
| filename=None, |
| file=DESCRIPTOR, |
| values=[ |
| _descriptor.EnumValueDescriptor( |
| name='BIG_BANG', index=0, number=0, |
| options=None, |
| type=None), |
| _descriptor.EnumValueDescriptor( |
| name='SMALL_BANG', index=1, number=1, |
| options=None, |
| type=None), |
| _descriptor.EnumValueDescriptor( |
| name='NO_BANG', index=2, number=2, |
| options=None, |
| type=None), |
| ], |
| containing_type=None, |
| options=None, |
| serialized_start=153, |
| serialized_end=207, |
| ) |
| _sym_db.RegisterEnumDescriptor(_ASYNCEVENT_EVENTTYPE) |
| |
| |
| _ASYNCEVENT = _descriptor.Descriptor( |
| name='AsyncEvent', |
| full_name='experiment.AsyncEvent', |
| filename=None, |
| file=DESCRIPTOR, |
| containing_type=None, |
| fields=[ |
| _descriptor.FieldDescriptor( |
| name='seq', full_name='experiment.AsyncEvent.seq', index=0, |
| number=1, type=5, cpp_type=1, label=1, |
| has_default_value=False, default_value=0, |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| _descriptor.FieldDescriptor( |
| name='type', full_name='experiment.AsyncEvent.type', index=1, |
| number=2, type=14, cpp_type=8, label=1, |
| has_default_value=False, default_value=0, |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| _descriptor.FieldDescriptor( |
| name='details', full_name='experiment.AsyncEvent.details', index=2, |
| number=3, type=9, cpp_type=9, label=1, |
| has_default_value=False, default_value=_b("").decode('utf-8'), |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| ], |
| extensions=[ |
| ], |
| nested_types=[], |
| enum_types=[ |
| _ASYNCEVENT_EVENTTYPE, |
| ], |
| options=None, |
| is_extendable=False, |
| syntax='proto3', |
| extension_ranges=[], |
| oneofs=[ |
| ], |
| serialized_start=61, |
| serialized_end=207, |
| ) |
| |
| |
| _PACKET = _descriptor.Descriptor( |
| name='Packet', |
| full_name='experiment.Packet', |
| filename=None, |
| file=DESCRIPTOR, |
| containing_type=None, |
| fields=[ |
| _descriptor.FieldDescriptor( |
| name='source', full_name='experiment.Packet.source', index=0, |
| number=1, type=5, cpp_type=1, label=1, |
| has_default_value=False, default_value=0, |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| _descriptor.FieldDescriptor( |
| name='content', full_name='experiment.Packet.content', index=1, |
| number=2, type=12, cpp_type=9, label=1, |
| has_default_value=False, default_value=_b(""), |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| ], |
| extensions=[ |
| ], |
| nested_types=[], |
| enum_types=[ |
| ], |
| options=None, |
| is_extendable=False, |
| syntax='proto3', |
| extension_ranges=[], |
| oneofs=[ |
| ], |
| serialized_start=209, |
| serialized_end=250, |
| ) |
| |
| |
| _ECHO = _descriptor.Descriptor( |
| name='Echo', |
| full_name='experiment.Echo', |
| filename=None, |
| file=DESCRIPTOR, |
| containing_type=None, |
| fields=[ |
| _descriptor.FieldDescriptor( |
| name='msg', full_name='experiment.Echo.msg', index=0, |
| number=1, type=9, cpp_type=9, label=1, |
| has_default_value=False, default_value=_b("").decode('utf-8'), |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| _descriptor.FieldDescriptor( |
| name='delay', full_name='experiment.Echo.delay', index=1, |
| number=2, type=2, cpp_type=6, label=1, |
| has_default_value=False, default_value=float(0), |
| message_type=None, enum_type=None, containing_type=None, |
| is_extension=False, extension_scope=None, |
| options=None), |
| ], |
| extensions=[ |
| ], |
| nested_types=[], |
| enum_types=[ |
| ], |
| options=None, |
| is_extendable=False, |
| syntax='proto3', |
| extension_ranges=[], |
| oneofs=[ |
| ], |
| serialized_start=252, |
| serialized_end=286, |
| ) |
| |
| _ASYNCEVENT.fields_by_name['type'].enum_type = _ASYNCEVENT_EVENTTYPE |
| _ASYNCEVENT_EVENTTYPE.containing_type = _ASYNCEVENT |
| DESCRIPTOR.message_types_by_name['AsyncEvent'] = _ASYNCEVENT |
| DESCRIPTOR.message_types_by_name['Packet'] = _PACKET |
| DESCRIPTOR.message_types_by_name['Echo'] = _ECHO |
| |
| AsyncEvent = _reflection.GeneratedProtocolMessageType('AsyncEvent', (_message.Message,), dict( |
| DESCRIPTOR = _ASYNCEVENT, |
| __module__ = 'streaming_pb2' |
| # @@protoc_insertion_point(class_scope:experiment.AsyncEvent) |
| )) |
| _sym_db.RegisterMessage(AsyncEvent) |
| |
| Packet = _reflection.GeneratedProtocolMessageType('Packet', (_message.Message,), dict( |
| DESCRIPTOR = _PACKET, |
| __module__ = 'streaming_pb2' |
| # @@protoc_insertion_point(class_scope:experiment.Packet) |
| )) |
| _sym_db.RegisterMessage(Packet) |
| |
| Echo = _reflection.GeneratedProtocolMessageType('Echo', (_message.Message,), dict( |
| DESCRIPTOR = _ECHO, |
| __module__ = 'streaming_pb2' |
| # @@protoc_insertion_point(class_scope:experiment.Echo) |
| )) |
| _sym_db.RegisterMessage(Echo) |
| |
| |
| import grpc |
| from grpc.beta import implementations as beta_implementations |
| from grpc.beta import interfaces as beta_interfaces |
| from grpc.framework.common import cardinality |
| from grpc.framework.interfaces.face import utilities as face_utilities |
| |
| |
| class ExperimentalServiceStub(object): |
| |
| def __init__(self, channel): |
| """Constructor. |
| |
| Args: |
| channel: A grpc.Channel. |
| """ |
| self.GetEcho = channel.unary_unary( |
| '/experiment.ExperimentalService/GetEcho', |
| request_serializer=Echo.SerializeToString, |
| response_deserializer=Echo.FromString, |
| ) |
| self.ReceiveStreamedEvents = channel.unary_stream( |
| '/experiment.ExperimentalService/ReceiveStreamedEvents', |
| request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| response_deserializer=AsyncEvent.FromString, |
| ) |
| self.ReceivePackets = channel.unary_stream( |
| '/experiment.ExperimentalService/ReceivePackets', |
| request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| response_deserializer=Packet.FromString, |
| ) |
| self.SendPackets = channel.stream_unary( |
| '/experiment.ExperimentalService/SendPackets', |
| request_serializer=Packet.SerializeToString, |
| response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| ) |
| |
| |
| class ExperimentalServiceServicer(object): |
| |
| def GetEcho(self, request, context): |
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| context.set_details('Method not implemented!') |
| raise NotImplementedError('Method not implemented!') |
| |
| def ReceiveStreamedEvents(self, request, context): |
| """For server to send async stream to client |
| """ |
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| context.set_details('Method not implemented!') |
| raise NotImplementedError('Method not implemented!') |
| |
| def ReceivePackets(self, request, context): |
| """For server to send async packets to client |
| """ |
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| context.set_details('Method not implemented!') |
| raise NotImplementedError('Method not implemented!') |
| |
| def SendPackets(self, request_iterator, context): |
| """For client to send async packets to server |
| """ |
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| context.set_details('Method not implemented!') |
| raise NotImplementedError('Method not implemented!') |
| |
| |
| def add_ExperimentalServiceServicer_to_server(servicer, server): |
| rpc_method_handlers = { |
| 'GetEcho': grpc.unary_unary_rpc_method_handler( |
| servicer.GetEcho, |
| request_deserializer=Echo.FromString, |
| response_serializer=Echo.SerializeToString, |
| ), |
| 'ReceiveStreamedEvents': grpc.unary_stream_rpc_method_handler( |
| servicer.ReceiveStreamedEvents, |
| request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| response_serializer=AsyncEvent.SerializeToString, |
| ), |
| 'ReceivePackets': grpc.unary_stream_rpc_method_handler( |
| servicer.ReceivePackets, |
| request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| response_serializer=Packet.SerializeToString, |
| ), |
| 'SendPackets': grpc.stream_unary_rpc_method_handler( |
| servicer.SendPackets, |
| request_deserializer=Packet.FromString, |
| response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| ), |
| } |
| generic_handler = grpc.method_handlers_generic_handler( |
| 'experiment.ExperimentalService', rpc_method_handlers) |
| server.add_generic_rpc_handlers((generic_handler,)) |
| |
| |
| class BetaExperimentalServiceServicer(object): |
| def GetEcho(self, request, context): |
| context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) |
| def ReceiveStreamedEvents(self, request, context): |
| """For server to send async stream to client |
| """ |
| context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) |
| def ReceivePackets(self, request, context): |
| """For server to send async packets to client |
| """ |
| context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) |
| def SendPackets(self, request_iterator, context): |
| """For client to send async packets to server |
| """ |
| context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) |
| |
| |
| class BetaExperimentalServiceStub(object): |
| def GetEcho(self, request, timeout, metadata=None, with_call=False, protocol_options=None): |
| raise NotImplementedError() |
| GetEcho.future = None |
| def ReceiveStreamedEvents(self, request, timeout, metadata=None, with_call=False, protocol_options=None): |
| """For server to send async stream to client |
| """ |
| raise NotImplementedError() |
| def ReceivePackets(self, request, timeout, metadata=None, with_call=False, protocol_options=None): |
| """For server to send async packets to client |
| """ |
| raise NotImplementedError() |
| def SendPackets(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): |
| """For client to send async packets to server |
| """ |
| raise NotImplementedError() |
| SendPackets.future = None |
| |
| |
| def beta_create_ExperimentalService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): |
| request_deserializers = { |
| ('experiment.ExperimentalService', 'GetEcho'): Echo.FromString, |
| ('experiment.ExperimentalService', 'ReceivePackets'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| ('experiment.ExperimentalService', 'SendPackets'): Packet.FromString, |
| } |
| response_serializers = { |
| ('experiment.ExperimentalService', 'GetEcho'): Echo.SerializeToString, |
| ('experiment.ExperimentalService', 'ReceivePackets'): Packet.SerializeToString, |
| ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): AsyncEvent.SerializeToString, |
| ('experiment.ExperimentalService', 'SendPackets'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| } |
| method_implementations = { |
| ('experiment.ExperimentalService', 'GetEcho'): face_utilities.unary_unary_inline(servicer.GetEcho), |
| ('experiment.ExperimentalService', 'ReceivePackets'): face_utilities.unary_stream_inline(servicer.ReceivePackets), |
| ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): face_utilities.unary_stream_inline(servicer.ReceiveStreamedEvents), |
| ('experiment.ExperimentalService', 'SendPackets'): face_utilities.stream_unary_inline(servicer.SendPackets), |
| } |
| server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) |
| return beta_implementations.server(method_implementations, options=server_options) |
| |
| |
| def beta_create_ExperimentalService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): |
| request_serializers = { |
| ('experiment.ExperimentalService', 'GetEcho'): Echo.SerializeToString, |
| ('experiment.ExperimentalService', 'ReceivePackets'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| ('experiment.ExperimentalService', 'SendPackets'): Packet.SerializeToString, |
| } |
| response_deserializers = { |
| ('experiment.ExperimentalService', 'GetEcho'): Echo.FromString, |
| ('experiment.ExperimentalService', 'ReceivePackets'): Packet.FromString, |
| ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): AsyncEvent.FromString, |
| ('experiment.ExperimentalService', 'SendPackets'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| } |
| cardinalities = { |
| 'GetEcho': cardinality.Cardinality.UNARY_UNARY, |
| 'ReceivePackets': cardinality.Cardinality.UNARY_STREAM, |
| 'ReceiveStreamedEvents': cardinality.Cardinality.UNARY_STREAM, |
| 'SendPackets': cardinality.Cardinality.STREAM_UNARY, |
| } |
| stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) |
| return beta_implementations.dynamic_stub(channel, 'experiment.ExperimentalService', cardinalities, options=stub_options) |
| # @@protoc_insertion_point(module_scope) |