Skip to content

Instantly share code, notes, and snippets.

@Cartmanishere
Created November 1, 2019 10:47
Show Gist options
  • Save Cartmanishere/59a2602b867b7953133590d7654e77e4 to your computer and use it in GitHub Desktop.
Save Cartmanishere/59a2602b867b7953133590d7654e77e4 to your computer and use it in GitHub Desktop.
Python server implementation for grpc-python-golang example
def serve(port):
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
add_KeywordServiceServicer_to_server(
NltkService(), server)
server.add_insecure_port('[::]:' + str(port))
server.start()
print("Listening on port {}..".format(port))
try:
while True:
time.sleep(10000)
except KeyboardInterrupt:
server.stop(0)
if __name__== "__main__":
serve(6000)
@hdospitia
Copy link

Hello Pranav,

Thanks so much for your help explaining basics of gRPC. It was a great challenge for me (Setting up Go workspace...), but finally it works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment