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

Function connect

src/slave/http.cpp:4185–4204  ·  view source on GitHub ↗

Helper that reads data from `writer` and writes to `reader`. Returns a failed future if there are any errors reading or writing. The future is satisfied when we get a EOF. TODO(vinod): Move this to libprocess if this is more generally useful.

Source from the content-addressed store, hash-verified

4183// The future is satisfied when we get a EOF.
4184// TODO(vinod): Move this to libprocess if this is more generally useful.
4185Future<Nothing> connect(Pipe::Reader reader, Pipe::Writer writer)
4186{
4187 return loop(
4188 None(),
4189 [=]() mutable {
4190 return reader.read();
4191 },
4192 [=](const string& chunk) mutable -> Future<ControlFlow<Nothing>> {
4193 if (chunk.empty()) {
4194 // EOF case.
4195 return Break();
4196 }
4197
4198 if (!writer.write(chunk)) {
4199 return Failure("Write failed to the pipe");
4200 }
4201
4202 return Continue();
4203 });
4204}
4205
4206
4207Future<Response> Http::launchNestedContainerSession(

Callers 15

connectMethod · 0.50
connectMethod · 0.50
_nestedCommandCheckMethod · 0.50
testTCPConnectFunction · 0.50
launchGroupMethod · 0.50
waitMethod · 0.50
retryMethod · 0.50
initializeMethod · 0.50
connectMethod · 0.50
backoffMethod · 0.50
TEST_PFunction · 0.50

Calls 8

loopFunction · 0.85
NoneClass · 0.85
FailureClass · 0.85
BreakFunction · 0.50
ContinueClass · 0.50
readMethod · 0.45
emptyMethod · 0.45
writeMethod · 0.45

Tested by 3

TEST_PFunction · 0.40
TEST_FFunction · 0.40