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

Function main

lib_acl_cpp/samples/redis/redis_trans/redis_trans.cpp:181–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181int main(int argc, char* argv[])
182{
183 int ch, conn_timeout = 10, rw_timeout = 10;
184 acl::string addr("127.0.0.1:6379");
185 bool slice_req = false;
186
187 while ((ch = getopt(argc, argv, "hs:C:I:S")) > 0)
188 {
189 switch (ch)
190 {
191 case 'h':
192 usage(argv[0]);
193 return 0;
194 case 's':
195 addr = optarg;
196 break;
197 case 'C':
198 conn_timeout = atoi(optarg);
199 break;
200 case 'I':
201 rw_timeout = atoi(optarg);
202 break;
203 case 'S':
204 slice_req = true;
205 break;
206 default:
207 break;
208 }
209 }
210
211 acl::acl_cpp_init();
212 acl::redis_client client(addr.c_str(), conn_timeout, rw_timeout);
213 client.set_slice_request(slice_req);
214 client.set_slice_respond(false);
215 acl::redis_transaction redis(&client);
216
217 bool ret;
218
219 ret = test_multi(redis) && test_run_cmds(redis)
220 && test_exec(redis) && get_results(redis);
221
222 printf("all cmds %s\r\n", ret ? "ok" : "failed");
223
224#ifdef WIN32
225 printf("enter any key to exit\r\n");
226 getchar();
227#endif
228 return 0;
229}

Callers

nothing calls this directly

Calls 10

acl_cpp_initFunction · 0.85
test_multiFunction · 0.85
test_run_cmdsFunction · 0.85
test_execFunction · 0.85
get_resultsFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
c_strMethod · 0.45
set_slice_requestMethod · 0.45
set_slice_respondMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…