fgerlits commented on code in PR #2120:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2120#discussion_r3000932337
##########
libminifi/src/core/ProcessSession.cpp:
##########
@@ -256,7 +257,15 @@ void ProcessSessionImpl::write(core::FlowFile &flow, const
io::OutputStreamCallb
if (nullptr == stream) {
throw Exception(FILE_OPERATION_EXCEPTION, "Failed to open flowfile
content for write");
}
- if (callback(stream) < 0) {
+ const auto callback_result = callback(stream);
+ if (callback_result == MinifiIoStatus::MINIFI_IO_CANCEL) {
Review Comment:
If someone is writing a new `io::OutputStreamCallback`, they will not know
that they can signal cancellation, or how to do it, unless they happen to find
and read this part of the source code.
Could we change `io::OutputStreamCallback` to return a `MinifiIoStatus`
instead of an integer, to make it easier for future developers?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]