MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / run

Method run

libminifi/src/TimerDrivenSchedulingAgent.cpp:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace minifi {
31
32utils::TaskRescheduleInfo TimerDrivenSchedulingAgent::run(const std::shared_ptr<core::Processor> &processor, const std::shared_ptr<core::ProcessContext> &processContext,
33 const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) {
34 if (this->running_ && processor->isRunning()) {
35 bool shouldYield = this->onTrigger(processor, processContext, sessionFactory);
36 if (processor->isYield()) {
37 // Honor the yield
38 return utils::TaskRescheduleInfo::RetryIn(std::chrono::milliseconds(processor->getYieldTime()));
39 } else if (shouldYield && this->bored_yield_duration_ > 0) {
40 // No work to do or need to apply back pressure
41 return utils::TaskRescheduleInfo::RetryIn(std::chrono::milliseconds(this->bored_yield_duration_));
42 }
43 return utils::TaskRescheduleInfo::RetryIn(std::chrono::duration_cast<std::chrono::milliseconds>(
44 std::chrono::nanoseconds(processor->getSchedulingPeriodNano())));
45 }
46 return utils::TaskRescheduleInfo::Done();
47}
48
49} /* namespace minifi */
50} /* namespace nifi */

Callers

nothing calls this directly

Calls 5

getYieldTimeMethod · 0.80
isRunningMethod · 0.45
onTriggerMethod · 0.45
isYieldMethod · 0.45

Tested by

no test coverage detected