adamdebreceni commented on a change in pull request #1044:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1044#discussion_r635874664
##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -241,6 +241,18 @@ void ProcessSession::write(const
std::shared_ptr<core::FlowFile> &flow, OutputSt
}
}
+void ProcessSession::writeBuffer(const std::shared_ptr<core::FlowFile>&
flow_file, gsl::span<const char> buffer) {
+ struct BufferOutputStreamCallback : OutputStreamCallback {
Review comment:
I recall a refactor concerning taking addresses of non-lvalues, due to
this we have some (not horribly many) instances of creating local callbacks for
the sole purpose of taking their addresses, creating a `ProcessSession(const
shrd_ptr<FF>&, OutputStreamCallback&&)` would handle these "forwarding"
use-cases (where the temporary callbacks only forward the stream data in some
implementation dependent manner),
I just would like to avoid the proliferation of "input/output-dependent"
methods on `ProcessSession` (like `writeFile`, `writeRawBuffer`, `writeString`,
etc.)
##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -241,6 +241,18 @@ void ProcessSession::write(const
std::shared_ptr<core::FlowFile> &flow, OutputSt
}
}
+void ProcessSession::writeBuffer(const std::shared_ptr<core::FlowFile>&
flow_file, gsl::span<const char> buffer) {
+ struct BufferOutputStreamCallback : OutputStreamCallback {
Review comment:
I recall a refactor concerning taking addresses of non-lvalues, due to
this we have some (not horribly many) instances of creating local callbacks for
the sole purpose of taking their addresses, creating a `ProcessSession(const
shrd_ptr<FF>&, OutputStreamCallback&&)` would handle these "forwarding"
use-cases (where the temporary callbacks only forward the stream data in some
implementation dependent manner),
I just would like to avoid the proliferation of "input/output-dependent"
methods on `ProcessSession` (like `writeFileStream`, `writeRawBuffer`,
`writeString`, etc.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]