MCPcopy Create free account
hub / github.com/NVIDIA/nvcf / serve

Function serve

examples/function-samples/grpc-echo-sample/grpc_echo_server.py:69–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68
69def serve():
70 port = "8001"
71 server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
72 echo_pb2_grpc.add_EchoServicer_to_server(Echo(), server)
73 server.add_insecure_port("[::]:" + port)
74 _configure_health_server(server)
75 reflection.enable_server_reflection((
76 echo_pb2.DESCRIPTOR.services_by_name['Echo'].full_name,
77 reflection.SERVICE_NAME,
78 ), server)
79 server.start()
80 print("Server started, listening on " + port)
81
82 server.wait_for_termination()
83
84
85if __name__ == "__main__":

Callers 1

Calls 3

EchoClass · 0.70
_configure_health_serverFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected