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

Function test_addjob

lib_acl_cpp/samples/disque/disque_client/disque_client.cpp:6–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4static acl::string __jobpre("test_job");
5
6static bool test_addjob(acl::disque& cmd, const acl::disque_cond& cond, int i)
7{
8 acl::string job;
9 int timeout = 0;
10 const char* jobid;
11
12 job.format("job_%s_%d", __jobpre.c_str(), i);
13 cmd.clear();
14 jobid = cmd.addjob(__queue, job, timeout, &cond);
15 if (jobid == NULL)
16 {
17 printf("addjob queue: %s error: %s\r\n",
18 __queue.c_str(), cmd.result_error());
19 return false;
20 }
21 else if (i < 10)
22 printf("addjob queue: %s ok, jobid: %s\r\n",
23 __queue.c_str(), jobid);
24
25 return true;
26}
27
28static bool test_ackjob(acl::disque& cmd,
29 const std::vector<acl::string>& job_ids, int i)

Callers 1

mainFunction · 0.70

Calls 5

addjobMethod · 0.80
result_errorMethod · 0.80
formatMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…