MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / operation

Method operation

include/exec/libdispatch_queue.hpp:214–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212 Receiver receiver;
213
214 operation(libdispatch_queue *queue_arg, Receiver rcvr)
215 : queue(*queue_arg)
216 , receiver(std::move(rcvr))
217 {
218 this->execute = [](task_base *t) noexcept
219 {
220 auto &op = *static_cast<operation *>(t);
221 auto stoken = STDEXEC::get_stop_token(STDEXEC::get_env(op.receiver));
222 if constexpr (STDEXEC::unstoppable_token<decltype(stoken)>)
223 {
224 STDEXEC::set_value(std::move(op.receiver));
225 }
226 else if (stoken.stop_requested())
227 {
228 STDEXEC::set_stopped(std::move(op.receiver));
229 }
230 else
231 {
232 STDEXEC::set_value(std::move(op.receiver));
233 }
234 };
235 }
236
237 void enqueue(task_base *op) const
238 {

Callers

nothing calls this directly

Calls 4

set_valueFunction · 0.85
get_envFunction · 0.70
set_stoppedFunction · 0.70
stop_requestedMethod · 0.45

Tested by

no test coverage detected