martinzink commented on code in PR #1815:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1815#discussion_r1668513561


##########
libminifi/src/EventDrivenSchedulingAgent.cpp:
##########
@@ -35,20 +35,51 @@ void EventDrivenSchedulingAgent::schedule(core::Processor* 
processor) {
   ThreadedSchedulingAgent::schedule(processor);
 }
 
-utils::TaskRescheduleInfo EventDrivenSchedulingAgent::run(core::Processor* 
processor, const std::shared_ptr<core::ProcessContext> &processContext,
-                                         const 
std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
-  if (this->running_) {
-    auto start_time = std::chrono::steady_clock::now();
-    // trigger processor until it has work to do, but no more than the 
configured nifi.flow.engine.event.driven.time.slice
+utils::TaskRescheduleInfo EventDrivenSchedulingAgent::run(core::Processor* 
processor,
+    const std::shared_ptr<core::ProcessContext>& process_context,
+    const std::shared_ptr<core::ProcessSessionFactory>& session_factory) {
+  if (!this->running_) {
+    return utils::TaskRescheduleInfo::Done();
+  }
+  if (processorYields(processor)) {
+    return 
utils::TaskRescheduleInfo::RetryAfter(processor->getYieldExpirationTime());
+  }
+
+  const auto start_time = std::chrono::steady_clock::now();
+  // trigger processor until it has work to do, but no more than the 
configured nifi.flow.engine.event.driven.time.slice
+
+  const auto process_session = session_factory->createSession();
+  process_session->setMetrics(processor->getMetrics());
+
+
+  try {

Review Comment:
   good point, how about this?
   
https://github.com/apache/nifi-minifi-cpp/pull/1815/commits/c6a9d06109f0af494b21982b7df51cfd97af5ee3



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

Reply via email to