szaszm commented on a change in pull request #718: MINIFICPP-1132 - CWEL should 
stop committing further flowfiles in cas…
URL: https://github.com/apache/nifi-minifi-cpp/pull/718#discussion_r372531069
 
 

 ##########
 File path: libminifi/src/core/ProcessSession.cpp
 ##########
 @@ -965,6 +965,18 @@ std::shared_ptr<core::FlowFile> ProcessSession::get() {
   return NULL;
 }
 
+bool ProcessSession::outgoingConnectionsFull(const std::string& relationship) {
+  std::set<std::shared_ptr<Connectable>> connections = 
process_context_->getProcessorNode()->getOutGoingConnections(relationship);
+  Connection * connection = nullptr;
+  for (const auto& conn : connections) {
+    connection = dynamic_cast<Connection*>(conn.get());
+    if (connection && connection->isFull()) {
+      return true;
+    }
+  }
+  return false;
 
 Review comment:
   Maybe `std::any_of` would be better, I've just learned about it. I still 
prefer anything higher level than a raw loop.
   Also see: C++ seasoning at ~4:30 https://www.youtube.com/watch?v=qH6sSOr-yk8
   
   I've already approved the PR since this is a minor detail, so feel free to 
merge it either way.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to