MCPcopy Create free account
hub / github.com/apache/arrow / operator()

Method operator()

cpp/src/arrow/util/async_generator.h:152–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 : state_(std::make_shared<State>(std::move(source), std::move(map))) {}
151
152 Future<V> operator()() {
153 auto future = Future<V>::Make();
154 bool should_trigger;
155 {
156 auto guard = state_->mutex.Lock();
157 if (state_->finished) {
158 return AsyncGeneratorEnd<V>();
159 }
160 should_trigger = state_->waiting_jobs.empty();
161 state_->waiting_jobs.push_back(future);
162 }
163 if (should_trigger) {
164 state_->source().AddCallback(Callback{state_});
165 }
166 return future;
167 }
168
169 private:
170 struct State {

Callers

nothing calls this directly

Calls 6

push_backMethod · 0.80
sourceMethod · 0.80
MakeFunction · 0.70
LockMethod · 0.45
emptyMethod · 0.45
AddCallbackMethod · 0.45

Tested by

no test coverage detected