MCPcopy Create free account
hub / github.com/bytedance/bolt / next

Method next

bolt/exec/ExchangeClient.cpp:131–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131std::vector<std::unique_ptr<SerializedPage>>
132ExchangeClient::next(uint32_t maxBytes, bool* atEnd, ContinueFuture* future) {
133 RequestSpec requestSpec;
134 std::vector<std::unique_ptr<SerializedPage>> pages;
135 {
136 std::lock_guard<std::mutex> l(queue_->mutex());
137 *atEnd = false;
138 pages = queue_->dequeueLocked(maxBytes, atEnd, future);
139 if (*atEnd) {
140 return pages;
141 }
142
143 if (!pages.empty() && queue_->totalBytes() > maxQueuedBytes_) {
144 return pages;
145 }
146
147 requestSpec = pickSourcesToRequestLocked();
148 }
149
150 // Outside of lock
151 request(requestSpec);
152 return pages;
153}
154
155void ExchangeClient::request(const RequestSpec& requestSpec) {
156 auto self = shared_from_this();

Callers

nothing calls this directly

Calls 3

dequeueLockedMethod · 0.80
totalBytesMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected