MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / start

Method start

src/runtime/task/simple_task_queue.cpp:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void simple_timer_service::start()
61{
62 if (_is_running) {
63 return;
64 }
65
66 _worker = std::thread([this]() {
67 task::set_tls_dsn_context(node(), nullptr);
68
69 char buffer[128];
70 sprintf(buffer, "%s.timer", get_service_node_name(node()));
71
72 task_worker::set_name(buffer);
73 task_worker::set_priority(worker_priority_t::THREAD_xPRIORITY_ABOVE_NORMAL);
74
75 boost::asio::io_service::work work(_ios);
76 boost::system::error_code ec;
77 _ios.run(ec);
78 CHECK(!ec, "io_service in simple_timer_service run failed: {}", ec.message());
79 });
80 _is_running = true;
81}
82
83void simple_timer_service::stop()
84{

Callers

nothing calls this directly

Calls 3

nodeClass · 0.85
get_service_node_nameFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected