Start server at the address.
Source code in iflearner/communication/base/base_server.py
| def start_server(addr: str, servicer: BaseServer) -> None:
"""Start server at the address."""
server = grpc.server(
futures.ThreadPoolExecutor(max_workers=10),
options=[
("grpc.max_message_length", constant.MAX_MSG_LENGTH),
("grpc.max_send_message_length", constant.MAX_MSG_LENGTH),
("grpc.max_receive_message_length", constant.MAX_MSG_LENGTH),
],
)
base_pb2_grpc.add_BaseServicer_to_server(servicer, server)
server.add_insecure_port(addr)
server.start()
server.wait_for_termination()
|