MCPcopy Create free account
hub / github.com/bufbuild/buf-examples / serve

Function serve

protovalidate/grpc-python/start/invoice_server.py:38–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36
37
38def serve():
39 server = grpc.server(
40 futures.ThreadPoolExecutor(max_workers=10),
41 )
42 invoice_service_pb2_grpc.add_InvoiceServiceServicer_to_server(
43 InvoiceService(), server
44 )
45 SERVICE_NAMES = (
46 invoice_service_pb2.DESCRIPTOR.services_by_name["InvoiceService"].full_name,
47 reflection.SERVICE_NAME,
48 )
49 reflection.enable_server_reflection(SERVICE_NAMES, server)
50
51 server.add_insecure_port("[::]:" + port)
52 logger.info("Invoice server started on port " + port)
53 server.start()
54 server.wait_for_termination()
55
56
57if __name__ == "__main__":

Callers 1

invoice_server.pyFile · 0.70

Calls 1

InvoiceServiceClass · 0.90

Tested by

no test coverage detected