MCPcopy Create free account
hub / github.com/ml-explore/mlx / recv_impl

Method recv_impl

mlx/distributed/ring/ring.cpp:181–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179 }
180
181 std::future<void> recv_impl(char* buffer, size_t size) {
182 std::promise<void> recv_completed_promise;
183 auto recv_completed_future = recv_completed_promise.get_future();
184 if (size == 0) {
185 recv_completed_promise.set_value();
186 return recv_completed_future;
187 }
188
189 {
190 std::unique_lock lock(queue_mutex_);
191 recvs_.emplace_back(
192 SocketTask(buffer, size, std::move(recv_completed_promise)));
193 }
194 condition_.notify_one();
195 return recv_completed_future;
196 }
197
198 bool have_tasks() {
199 return !(sends_.empty() && recvs_.empty());

Callers

nothing calls this directly

Calls 3

SocketTaskClass · 0.85
set_valueMethod · 0.80
emplace_backMethod · 0.80

Tested by

no test coverage detected