| 78 | } |
| 79 | |
| 80 | void LuaProcessSession::write(const std::shared_ptr<script::ScriptFlowFile> &script_flow_file, |
| 81 | sol::table output_stream_callback) { |
| 82 | if (!session_) { |
| 83 | throw std::runtime_error("Access of ProcessSession after it has been released"); |
| 84 | } |
| 85 | |
| 86 | auto flow_file = script_flow_file->getFlowFile(); |
| 87 | |
| 88 | if (!flow_file) { |
| 89 | throw std::runtime_error("Access of FlowFile after it has been released"); |
| 90 | } |
| 91 | |
| 92 | LuaOutputStreamCallback lua_callback(output_stream_callback); |
| 93 | session_->write(flow_file, &lua_callback); |
| 94 | } |
| 95 | |
| 96 | std::shared_ptr<script::ScriptFlowFile> LuaProcessSession::create() { |
| 97 | if (!session_) { |
nothing calls this directly
no test coverage detected