MCPcopy Create free account
hub / github.com/ashvardanian/less_slow.cpp / reuse_buffer

Method reuse_buffer

less_slow.cpp:7708–7719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7706
7707 private:
7708 void reuse_buffer(std::size_t job) {
7709 auto finalize = [this, job](std::error_code error, std::size_t) {
7710 if (error) failed_responses_++;
7711 if (should_stop_.load(std::memory_order_seq_cst)) return;
7712 reuse_buffer(job);
7713 };
7714 auto respond = [this, finalize, job](std::error_code error, std::size_t bytes) {
7715 if (error) { reuse_buffer(job); }
7716 else { socket_.async_send_to(asio::buffer(buffers_[job], bytes), clients_[job], finalize); }
7717 };
7718 socket_.async_receive_from(asio::buffer(buffers_[job]), clients_[job], respond);
7719 }
7720};
7721
7722class rpc_asio_client {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected