aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/python/helloworld/greeter_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/python/helloworld/greeter_client.py')
-rw-r--r--[-rwxr-xr-x]examples/python/helloworld/greeter_client.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/python/helloworld/greeter_client.py b/examples/python/helloworld/greeter_client.py
index 370ce46770..561b25bcb2 100755..100644
--- a/examples/python/helloworld/greeter_client.py
+++ b/examples/python/helloworld/greeter_client.py
@@ -29,15 +29,18 @@
"""The Python implementation of the GRPC helloworld.Greeter client."""
+from grpc.beta import implementations
+
import helloworld_pb2
_TIMEOUT_SECONDS = 10
def run():
- with helloworld_pb2.early_adopter_create_Greeter_stub('localhost', 50051) as stub:
- response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), _TIMEOUT_SECONDS)
- print "Greeter client received: " + response.message
+ channel = implementations.insecure_channel('localhost', 50051)
+ stub = helloworld_pb2.beta_create_Greeter_stub(channel)
+ response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), _TIMEOUT_SECONDS)
+ print "Greeter client received: " + response.message
if __name__ == '__main__':