()
| 36 | |
| 37 | |
| 38 | def 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 | |
| 57 | if __name__ == "__main__": |
no test coverage detected