MCPcopy Create free account
hub / github.com/apache/mesos / loop

Function loop

3rdparty/libprocess/include/process/loop.hpp:132–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 typename CF = typename internal::unwrap<typename result_of<Body(T)>::type>::type, // NOLINT(whitespace/line_length)
131 typename V = typename CF::ValueType>
132Future<V> loop(Iterate&& iterate, Body&& body)
133{
134 // Have libprocess own and free the new `ProcessBase`.
135 UPID process = spawn(new ProcessBase(), true);
136
137 return loop<Iterate, Body, T, CF, V>(
138 process,
139 std::forward<Iterate>(iterate),
140 std::forward<Body>(body))
141 .onAny([=]() {
142 terminate(process);
143 // NOTE: no need to `wait` or `delete` since the `spawn` above
144 // put libprocess in control of garbage collection.
145 });
146}
147
148
149// Generic "control flow" construct that is leveraged by

Callers 15

spliceFunction · 0.85
readFunction · 0.85
writeFunction · 0.85
readAllMethod · 0.85
encodeFunction · 0.85
_sendMethod · 0.85
sendFunction · 0.85
streamFunction · 0.85
receiveFunction · 0.85
serveFunction · 0.85
runMethod · 0.85
receiveFunction · 0.85

Calls 4

spawnFunction · 0.70
terminateFunction · 0.70
startMethod · 0.65
createFunction · 0.50

Tested by 4

TESTFunction · 0.68
TESTFunction · 0.68
TEST_PFunction · 0.68
_subscribeMethod · 0.68