aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/python/helloworld/greeter_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/python/helloworld/greeter_server.py')
-rw-r--r--examples/python/helloworld/greeter_server.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/python/helloworld/greeter_server.py b/examples/python/helloworld/greeter_server.py
index 37d8bd49cc..0afc21d243 100644
--- a/examples/python/helloworld/greeter_server.py
+++ b/examples/python/helloworld/greeter_server.py
@@ -35,11 +35,12 @@ import time
import grpc
import helloworld_pb2
+import helloworld_pb2_grpc
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
-class Greeter(helloworld_pb2.GreeterServicer):
+class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)
@@ -47,7 +48,7 @@ class Greeter(helloworld_pb2.GreeterServicer):
def serve():
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
- helloworld_pb2.add_GreeterServicer_to_server(Greeter(), server)
+ helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
server.add_insecure_port('[::]:50051')
server.start()
try: