MCPcopy Create free account
hub / github.com/apache/arrow / do_action

Method do_action

python/examples/flight/server.py:100–111  ·  view source on GitHub ↗
(self, context, action)

Source from the content-addressed store, hash-verified

98 ]
99
100 def do_action(self, context, action):
101 if action.type == "clear":
102 raise NotImplementedError(f"{action.type} is not implemented.")
103 elif action.type == "healthcheck":
104 pass
105 elif action.type == "shutdown":
106 yield pyarrow.flight.Result(pyarrow.py_buffer(b'Shutdown!'))
107 # Shut down on background thread to avoid blocking current
108 # request
109 threading.Thread(target=self._shutdown).start()
110 else:
111 raise KeyError(f"Unknown action {action.type!r}")
112
113 def _shutdown(self):
114 """Shut down after a delay."""

Callers 2

do_actionFunction · 0.45
mainFunction · 0.45

Calls 3

KeyErrorFunction · 0.85
ResultMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected