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

Method run

lib_acl_cpp/samples/disque/disque_manager/disque_manager.cpp:139–186  ·  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_pool* pool;
143 acl::disque_client* conn;
144 acl::disque cmd;
145
146 for (int i = 0; i < n_; i++)
147 {
148 pool = (acl::disque_client_pool*) manager_.peek();
149 if (pool == NULL)
150 {
151 printf("peek connection pool failed\r\n");
152 break;
153 }
154
155 conn = (acl::disque_client*) pool->peek();
156
157 if (conn == NULL)
158 {
159 printf("peek disque_client failed\r\n");
160 break;
161 }
162
163 cmd.set_client(conn);
164
165 if (cmd_ == "addjob")
166 ret = test_addjob(cmd, cond_, i);
167 else if (cmd_ == "getjob")
168 ret = test_getjob(cmd, i);
169 else if (cmd_ == "qlen")
170 ret = test_qlen(cmd, i);
171 else if (cmd_ == "qpeek")
172 ret = test_qpeek(cmd, i);
173 else
174 {
175 printf("unknown cmd: %s\r\n", cmd_.c_str());
176 break;
177 }
178
179 pool->put(conn, ret);
180
181 if (ret == false)
182 break;
183 }
184
185 return NULL;
186 }
187
188private:
189 acl::disque_client_cluster& manager_;

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