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

Method run

lib_acl_cpp/samples/disque/disque_pool/disque_pool.cpp:139–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138protected:
139 virtual void* run()
140 {
141 bool ret;
142 acl::disque_client* conn;
143 acl::disque cmd;
144
145 for (int i = 0; i < n_; i++)
146 {
147 conn = (acl::disque_client*) pool_.peek();
148
149 if (conn == NULL)
150 {
151 printf("peek disque_client failed\r\n");
152 break;
153 }
154
155 cmd.set_client(conn);
156
157 if (cmd_ == "addjob")
158 ret = test_addjob(cmd, cond_, i);
159 else if (cmd_ == "getjob")
160 ret = test_getjob(cmd, i);
161 else if (cmd_ == "qlen")
162 ret = test_qlen(cmd, i);
163 else if (cmd_ == "qpeek")
164 ret = test_qpeek(cmd, i);
165 else
166 {
167 printf("unknown cmd: %s\r\n", cmd_.c_str());
168 break;
169 }
170
171 pool_.put(conn, ret);
172 if (ret == false)
173 break;
174 }
175
176 return NULL;
177 }
178
179private:
180 acl::disque_client_pool& pool_;

Callers

nothing calls this directly

Calls 8

set_clientMethod · 0.80
test_addjobFunction · 0.70
test_getjobFunction · 0.70
test_qlenFunction · 0.70
test_qpeekFunction · 0.70
peekMethod · 0.45
c_strMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected