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

Method operator()

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

Read an item from the queue

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

MakeFunction · 0.70
LockMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected