Debian Codegraph @

examples/python/hellostreamingworld/hellostreamingworld_pb2_grpc.py

raw
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
5 import hellostreamingworld_pb2 as hellostreamingworld__pb2
6
7
8 class MultiGreeterStub(object):
9 """The greeting service definition.
10 """
11
12 def __init__(self, channel):
13 """Constructor.
14
15 Args:
16 channel: A grpc.Channel.
17 """
18 self.sayHello = channel.unary_stream(
19 '/hellostreamingworld.MultiGreeter/sayHello',
20 request_serializer=hellostreamingworld__pb2.HelloRequest.SerializeToString,
21 response_deserializer=hellostreamingworld__pb2.HelloReply.FromString,
22 )
23
24
25 class MultiGreeterServicer(object):
26 """The greeting service definition.
27 """
28
29 def sayHello(self, request, context):
30 """Sends multiple greetings
31 """
32 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
33 context.set_details('Method not implemented!')
34 raise NotImplementedError('Method not implemented!')
35
36
37 def add_MultiGreeterServicer_to_server(servicer, server):
38 rpc_method_handlers = {
39 'sayHello': grpc.unary_stream_rpc_method_handler(
40 servicer.sayHello,
41 request_deserializer=hellostreamingworld__pb2.HelloRequest.FromString,
42 response_serializer=hellostreamingworld__pb2.HelloReply.SerializeToString,
43 ),
44 }
45 generic_handler = grpc.method_handlers_generic_handler(
46 'hellostreamingworld.MultiGreeter', rpc_method_handlers)
47 server.add_generic_rpc_handlers((generic_handler,))
48
49
50 # This class is part of an EXPERIMENTAL API.
51 class MultiGreeter(object):
52 """The greeting service definition.
53 """
54
55 @staticmethod
56 def sayHello(request,
57 target,
58 options=(),
59 channel_credentials=None,
60 call_credentials=None,
61 insecure=False,
62 compression=None,
63 wait_for_ready=None,
64 timeout=None,
65 metadata=None):
66 return grpc.experimental.unary_stream(request, target, '/hellostreamingworld.MultiGreeter/sayHello',
67 hellostreamingworld__pb2.HelloRequest.SerializeToString,
68 hellostreamingworld__pb2.HelloReply.FromString,
69 options, channel_credentials,
70 insecure, call_credentials, compression, wait_for_ready, timeout, metadata)