MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / wait_for_all

Method wait_for_all

tools/server/server-queue.cpp:409–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409server_response_reader::batch_response server_response_reader::wait_for_all(const std::function<bool()> & should_stop) {
410 batch_response batch_res;
411 batch_res.results.clear();
412 batch_res.results.resize(id_tasks.size());
413 while (has_next()) {
414 auto res = next(should_stop);
415 if (res == nullptr) {
416 batch_res.is_terminated = true;
417 return batch_res;
418 }
419 if (res->is_error()) {
420 batch_res.error = std::move(res);
421 return batch_res;
422 }
423 const size_t idx = res->index;
424 GGML_ASSERT(idx < batch_res.results.size() && "index out of range");
425 GGML_ASSERT(batch_res.results[idx] == nullptr && "duplicate result received");
426 batch_res.results[idx] = std::move(res);
427 }
428 return batch_res;
429}
430
431void server_response_reader::stop() {
432 queue_results.remove_waiting_task_ids(id_tasks);

Callers 3

init_routesMethod · 0.80

Calls 4

clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
is_errorMethod · 0.45

Tested by

no test coverage detected