Create a server for pushing examples and starts it. Args: port: Port for the gRPC server to listen on. servicer: A PreprocessingServicer object. Returns: A grpc.Server object.
(port, servicer)
| 53 | |
| 54 | |
| 55 | def create_and_start_server(port, servicer): |
| 56 | """Create a server for pushing examples and starts it. |
| 57 | |
| 58 | |
| 59 | Args: |
| 60 | port: Port for the gRPC server to listen on. |
| 61 | servicer: A PreprocessingServicer object. |
| 62 | |
| 63 | Returns: |
| 64 | A grpc.Server object. |
| 65 | """ |
| 66 | server = grpc.server(logging_pool.pool(max_workers=25)) |
| 67 | preprocessing_pb2_grpc.add_PreprocessingServicer_to_server(servicer, server) |
| 68 | address = "[::]:%d" % port |
| 69 | tf.logging.info("Create preprocessing server at %s", address) |
| 70 | server.add_insecure_port(address) |
| 71 | server.start() |
| 72 | return server |
| 73 | |
| 74 | |
| 75 |
no outgoing calls
no test coverage detected
searching dependent graphs…