MCPcopy Create free account
hub / github.com/3rdparty/libprocess / consume

Method consume

src/tests/benchmarks.cpp:424–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422
423protected:
424 void consume(MessageEvent&& event) override
425 {
426 if (event.message.name == "pong") {
427 received += 1;
428 if (sent < repeat) {
429 send(destination, "ping");
430 sent += 1;
431 } else if (received >= repeat) {
432 latch->decrement();
433 }
434 } else if (event.message.name == "run") {
435 for (long l = 0; l < std::min(1000L, repeat); l++) {
436 send(destination, "ping");
437 sent += 1;
438 }
439 }
440 }
441
442private:
443 UPID destination;

Callers

nothing calls this directly

Calls 2

decrementMethod · 0.80
sendFunction · 0.50

Tested by

no test coverage detected