MCPcopy Create free account
hub / github.com/3rdparty/libprocess / operator()

Method operator()

include/process/dispatch.hpp:139–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137{
138 template <typename F>
139 Future<R> operator()(const UPID& pid, F&& f)
140 {
141 std::unique_ptr<Promise<R>> promise(new Promise<R>());
142 Future<R> future = promise->future();
143
144 std::unique_ptr<lambda::CallableOnce<void(ProcessBase*)>> f_(
145 new lambda::CallableOnce<void(ProcessBase*)>(
146 lambda::partial(
147 [](std::unique_ptr<Promise<R>> promise,
148 typename std::decay<F>::type&& f,
149 ProcessBase*) {
150 promise->set(std::move(f)());
151 },
152 std::move(promise),
153 std::forward<F>(f),
154 lambda::_1)));
155
156 internal::dispatch(pid, std::move(f_));
157
158 return future;
159 }
160};
161
162} // namespace internal {

Callers

nothing calls this directly

Calls 3

futureMethod · 0.80
dispatchFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected