| |
---|
| | class HostCommand(grpcdemo_pb2_grpc.HostCommandServicer): |
---|
| | |
---|
| | def runcommand(self, request, context): |
---|
| | time.sleep(DELAY) |
---|
| | return grpcdemo_pb2.Results(cmd_results=subprocess.check_output(request.command.split())) |
---|
| | return grpcdemo_pb2.Results(cmd_results="%s: %s" % (socket.getfqdn(), subprocess.check_output(request.command.split()))) |
---|
| | |
---|
| | |
---|
| | def serve(): |
---|
| | server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) |
---|
| |
---|
| | |