| 84 | } |
| 85 | |
| 86 | void PyProcessSession::write(std::shared_ptr<script::ScriptFlowFile> script_flow_file, |
| 87 | py::object output_stream_callback) { |
| 88 | if (!session_) { |
| 89 | throw std::runtime_error("Access of ProcessSession after it has been released"); |
| 90 | } |
| 91 | |
| 92 | auto flow_file = script_flow_file->getFlowFile(); |
| 93 | |
| 94 | if (!flow_file) { |
| 95 | throw std::runtime_error("Access of FlowFile after it has been released"); |
| 96 | } |
| 97 | |
| 98 | PyOutputStreamCallback py_callback(output_stream_callback); |
| 99 | session_->write(flow_file, &py_callback); |
| 100 | } |
| 101 | |
| 102 | std::shared_ptr<script::ScriptFlowFile> PyProcessSession::create() { |
| 103 | if (!session_) { |
nothing calls this directly
no test coverage detected