MCPcopy Create free account
hub / github.com/Codesire-Deng/co_context / main

Function main

example/channel.cpp:32–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32int main() {
33 io_context ctx[6];
34 ctx[0].co_spawn(produce("p0"));
35 ctx[1].co_spawn(produce("p1"));
36 ctx[2].co_spawn(produce("p2"));
37
38 ctx[3].co_spawn(consume("c0"));
39 ctx[4].co_spawn(consume("c1"));
40 ctx[5].co_spawn(consume("c2"));
41
42 for (auto &c : ctx) {
43 c.start();
44 }
45
46 ctx[0].join();
47 return 0;
48}

Callers

nothing calls this directly

Calls 5

produceFunction · 0.85
consumeFunction · 0.85
startMethod · 0.80
joinMethod · 0.80
co_spawnMethod · 0.45

Tested by

no test coverage detected