MCPcopy Create free account
hub / github.com/apache/arrow / ShouldScheduleCallback

Method ShouldScheduleCallback

cpp/src/arrow/util/future.cc:83–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 static bool ShouldScheduleCallback(const CallbackRecord& callback_record,
84 bool in_add_callback) {
85 switch (callback_record.options.should_schedule) {
86 case ShouldSchedule::Never:
87 return false;
88 case ShouldSchedule::Always:
89 return true;
90 case ShouldSchedule::IfUnfinished:
91 return !in_add_callback;
92 case ShouldSchedule::IfDifferentExecutor:
93 return !(callback_record.options.executor->IsCurrentExecutor());
94 default:
95 DCHECK(false) << "Unrecognized ShouldSchedule option";
96 return false;
97 }
98 }
99
100 static void RunOrScheduleCallback(const std::shared_ptr<FutureImpl>& self,
101 CallbackRecord&& callback_record,

Callers

nothing calls this directly

Calls 1

IsCurrentExecutorMethod · 0.80

Tested by

no test coverage detected