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

Method read

3rdparty/libprocess/src/http.cpp:459–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457
458
459Future<string> Pipe::Reader::read()
460{
461 synchronized (data->lock) {
462 if (data->readEnd == Reader::CLOSED) {
463 return Failure("closed");
464 } else if (!data->writes.empty()) {
465 Future<string> future = data->writes.front();
466 data->writes.pop();
467 return future;
468 } else if (data->writeEnd == Writer::CLOSED) {
469 return ""; // End-of-file.
470 } else if (data->writeEnd == Writer::FAILED) {
471 CHECK_SOME(data->failure);
472 return data->failure.get();
473 } else {
474 data->reads.push(Owned<Promise<string>>(new Promise<string>()));
475 return data->reads.back()->future();
476 }
477 }
478}
479
480
481Future<string> Pipe::Reader::readAll()

Callers 9

processMethod · 0.45
streamMethod · 0.45
readAllMethod · 0.45
encodeFunction · 0.45
_sendMethod · 0.45
streamFunction · 0.45
TESTFunction · 0.45
TEST_PFunction · 0.45
TESTFunction · 0.45

Calls 6

FailureClass · 0.85
pushMethod · 0.80
synchronizedFunction · 0.70
emptyMethod · 0.45
getMethod · 0.45
futureMethod · 0.45

Tested by 3

TESTFunction · 0.36
TEST_PFunction · 0.36
TESTFunction · 0.36