szaszm commented on a change in pull request #1044:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1044#discussion_r636042420



##########
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 just would like to avoid the proliferation of 
"input/output-dependent" methods on ProcessSession (like writeFileStream, 
writeRawBuffer, writeString, etc.)
   
   I don't want this either, but a buffer is a very basic concept and it's 
expected by almost all write functions in existence. A `gsl::span` is just a 
pointer and a size. I believe `writeBuffer` is the most basic and generic 
interface possible to write to a flow file, and therefore it should be in 
`ProcessSession`.
   
   > 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),
   
   What's your opinion about this? https://pastebin.com/q7d67x1j




-- 
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:
us...@infra.apache.org


Reply via email to