hellostreamingworld_pb2_grpc.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
  2. """Client and server classes corresponding to protobuf-defined services."""
  3. import grpc
  4. import hellostreamingworld_pb2 as hellostreamingworld__pb2
  5. class MultiGreeterStub(object):
  6. """The greeting service definition.
  7. """
  8. def __init__(self, channel):
  9. """Constructor.
  10. Args:
  11. channel: A grpc.Channel.
  12. """
  13. self.sayHello = channel.unary_stream(
  14. '/hellostreamingworld.MultiGreeter/sayHello',
  15. request_serializer=hellostreamingworld__pb2.HelloRequest.SerializeToString,
  16. response_deserializer=hellostreamingworld__pb2.HelloReply.FromString,
  17. )
  18. class MultiGreeterServicer(object):
  19. """The greeting service definition.
  20. """
  21. def sayHello(self, request, context):
  22. """Sends multiple greetings
  23. """
  24. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  25. context.set_details('Method not implemented!')
  26. raise NotImplementedError('Method not implemented!')
  27. def add_MultiGreeterServicer_to_server(servicer, server):
  28. rpc_method_handlers = {
  29. 'sayHello': grpc.unary_stream_rpc_method_handler(
  30. servicer.sayHello,
  31. request_deserializer=hellostreamingworld__pb2.HelloRequest.FromString,
  32. response_serializer=hellostreamingworld__pb2.HelloReply.SerializeToString,
  33. ),
  34. }
  35. generic_handler = grpc.method_handlers_generic_handler(
  36. 'hellostreamingworld.MultiGreeter', rpc_method_handlers)
  37. server.add_generic_rpc_handlers((generic_handler,))
  38. # This class is part of an EXPERIMENTAL API.
  39. class MultiGreeter(object):
  40. """The greeting service definition.
  41. """
  42. @staticmethod
  43. def sayHello(request,
  44. target,
  45. options=(),
  46. channel_credentials=None,
  47. call_credentials=None,
  48. insecure=False,
  49. compression=None,
  50. wait_for_ready=None,
  51. timeout=None,
  52. metadata=None):
  53. return grpc.experimental.unary_stream(request, target, '/hellostreamingworld.MultiGreeter/sayHello',
  54. hellostreamingworld__pb2.HelloRequest.SerializeToString,
  55. hellostreamingworld__pb2.HelloReply.FromString,
  56. options, channel_credentials,
  57. insecure, call_credentials, compression, wait_for_ready, timeout, metadata)