Skip to content

Commit bb5ea94

Browse files
Mike ProsserMike Prosser
authored andcommitted
remove unused serve() function
1 parent a6c76d6 commit bb5ea94

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed
Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import time
2-
from concurrent import futures
31
from typing import Any
42

53
import google.protobuf.any_pb2 as any_pb2
6-
import grpc
74
from ni.pythonpanel.v1.python_panel_service_pb2 import (
85
ConnectRequest,
96
ConnectResponse,
@@ -14,10 +11,7 @@
1411
SetValueRequest,
1512
SetValueResponse,
1613
)
17-
from ni.pythonpanel.v1.python_panel_service_pb2_grpc import (
18-
PythonPanelServiceServicer,
19-
add_PythonPanelServiceServicer_to_server,
20-
)
14+
from ni.pythonpanel.v1.python_panel_service_pb2_grpc import PythonPanelServiceServicer
2115

2216

2317
class FakePythonPanelServicer(PythonPanelServiceServicer):
@@ -44,21 +38,3 @@ def SetValue(self, request: SetValueRequest, context: Any) -> SetValueResponse:
4438
"""Just a trivial implementation for testing."""
4539
self._values[request.value_id] = request.value
4640
return SetValueResponse()
47-
48-
49-
def serve() -> None:
50-
"""Run the gRPC server."""
51-
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
52-
add_PythonPanelServiceServicer_to_server(FakePythonPanelServicer(), server)
53-
server.add_insecure_port("[::]:50051") # TODO: do we need to find a free port?
54-
server.start()
55-
print("Server is running on port 50051...")
56-
try:
57-
while True:
58-
time.sleep(86400) # Keep the server running
59-
except KeyboardInterrupt:
60-
server.stop(0)
61-
62-
63-
if __name__ == "__main__":
64-
serve()

0 commit comments

Comments
 (0)