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

Method operator()

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

Read an item from the queue

Source from the content-addressed store, hash-verified

942
943 /// Read an item from the queue
944 Future<T> operator()() const {
945 auto lock = state_->mutex.Lock();
946 assert(!state_->consumer_fut.has_value()); // Non-reentrant
947 if (!state_->result_q.empty()) {
948 auto fut = Future<T>::MakeFinished(std::move(state_->result_q.front()));
949 state_->result_q.pop_front();
950 return fut;
951 }
952 if (state_->finished) {
953 return AsyncGeneratorEnd<T>();
954 }
955 auto fut = Future<T>::Make();
956 state_->consumer_fut = fut;
957 return fut;
958 }
959
960 /// \brief Return producer-side interface
961 ///

Callers

nothing calls this directly

Calls 3

MakeFunction · 0.70
LockMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected