MCPcopy Create free account
hub / github.com/baidu/babylon / main

Function main

example/use-execution-queue/example.cpp:98–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98int main(int argc, char* argv[]) {
99 ::gflags::ParseCommandLineFlags(&argc, &argv, true);
100
101 ::brpc::StartDummyServerAt(FLAGS_dummy_port);
102
103 pending.expose("test_" + FLAGS_mode + "_pending");
104 latency.expose("test_" + FLAGS_mode);
105
106 if (FLAGS_mode == "babylon") {
107 babylon_queue.initialize(1L << 18, ::babylon::BthreadExecutor::instance(),
108 babylon_queue_consume);
109 } else if (FLAGS_mode == "bthread") {
110 ::bthread::ExecutionQueueOptions options;
111 ::bthread::execution_queue_start(&bthread_queue_id, &options,
112 bthread_queue_consume, nullptr);
113 } else {
114 return 0;
115 }
116
117 run_loop();
118
119 return 0;
120}

Callers

nothing calls this directly

Calls 3

run_loopFunction · 0.70
exposeMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected