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

Function set

lib_acl_cpp/samples/mem_cache/main.cpp:66–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static void set(const char* addr, int id, int num)
67{
68 acl::mem_cache client(addr);
69 acl::string buf, key;
70 int i;
71
72 client.set_prefix(__key);
73
74 for (i = 0; i < num; i++)
75 {
76 key.format("key:%d:%d", id, i);
77 buf.format("dat:%d, sp( ), tab(\t), eq(=);", i);
78 if (client.set(key.c_str(), buf, buf.length(), __timeout) == false)
79 {
80 printf("SET error: %s\n", client.last_serror());
81 break;
82 }
83 if (i <= 100)
84 printf("SET: %s\n", key.c_str());
85 if (i % 10000 == 0)
86 {
87 char tmp[256];
88 snprintf(tmp, sizeof(tmp), "SET, i: %d, num: %d, timeout: %d",
89 i, num, (int) __timeout);
90 ACL_METER_TIME(tmp);
91 }
92 }
93 client.property_list();
94 printf("OVER: total: %d, timeout: %d\n", i, (int) __timeout);
95}
96
97static void del(const char* addr, int id, int num)
98{

Callers 15

setMethod · 0.85
initMethod · 0.85
acl_foreachFunction · 0.85
setMethod · 0.85
setMethod · 0.85
url_coderMethod · 0.85
url_coder.cppFile · 0.85
set_all_slotMethod · 0.85
setMethod · 0.85
pgsql_manager.cppFile · 0.85
mysql_manager.cppFile · 0.85
sqlite_manager.cppFile · 0.85

Calls 6

property_listMethod · 0.80
formatMethod · 0.45
setMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45
last_serrorMethod · 0.45

Tested by

no test coverage detected