MCPcopy Create free account
hub / github.com/acl-dev/acl / check_job

Class check_job

lib_acl_cpp/src/connpool/connect_pool.cpp:12–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace acl {
11
12class check_job : public thread_job {
13public:
14 check_job(tbox<bool>& box, connect_client& conn, bool opened)
15 : box_(box), conn_(conn), opened_(opened), aliving_(true) {}
16
17 ~check_job() {}
18
19 // Get the checking result for the given connection.
20 bool aliving() const {
21 return aliving_;
22 }
23
24 // Get the connection.
25 connect_client& get_conn() const {
26 return conn_;
27 }
28
29protected:
30 // @overide
31 void* run() {
32 if (opened_) {
33 aliving_ = conn_.alive();
34 } else {
35 aliving_ = conn_.open();
36 }
37
38 box_.push(NULL);
39 return NULL;
40 }
41
42private:
43 tbox<bool>& box_;
44 connect_client& conn_;
45 bool opened_;
46 bool aliving_;
47};
48
49connect_pool::connect_pool(const char* addr, size_t max, size_t idx /* = 0 */)
50: alive_(true)

Callers 2

check_deadMethod · 0.85
keep_connsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…