| 370 | } |
| 371 | |
| 372 | bool redis_list::bpop(const char* cmd, const std::vector<const char*>& keys, |
| 373 | size_t timeout, std::pair<string, string>& result) |
| 374 | { |
| 375 | size_t argc = 2 + keys.size(); |
| 376 | const char** args = (const char**) dbuf_->dbuf_alloc(argc * sizeof(char*)); |
| 377 | size_t* lens = (size_t*) dbuf_->dbuf_alloc(argc * sizeof(size_t)); |
| 378 | |
| 379 | args[0] = cmd; |
| 380 | lens[0] = strlen(cmd); |
| 381 | |
| 382 | size_t i = 1; |
| 383 | std::vector<const char*>::const_iterator cit = keys.begin(); |
| 384 | for (; cit != keys.end(); ++cit) { |
| 385 | args[i] = *cit; |
| 386 | lens[i] = strlen(args[i]); |
| 387 | i++; |
| 388 | } |
| 389 | |
| 390 | char* buf = (char*) dbuf_->dbuf_alloc(LONG_LEN); |
| 391 | safe_snprintf(buf, LONG_LEN, "%lu", (unsigned long) timeout); |
| 392 | args[i] = buf; |
| 393 | lens[i] = strlen(args[i]); |
| 394 | |
| 395 | build_request(argc, args, lens); |
| 396 | return bpop(result); |
| 397 | } |
| 398 | |
| 399 | bool redis_list::bpop(const char* cmd, const std::vector<string>& keys, |
| 400 | size_t timeout, std::pair<string, string>& result) |
nothing calls this directly
no test coverage detected