| 349 | } |
| 350 | |
| 351 | const disque_job* disque::show(const char* job_id) |
| 352 | { |
| 353 | if (job_) { |
| 354 | delete job_; |
| 355 | job_ = NULL; |
| 356 | } |
| 357 | |
| 358 | size_t argc = 2; |
| 359 | const char* argv[2]; |
| 360 | size_t lens[2]; |
| 361 | |
| 362 | argv[0] = "SHOW"; |
| 363 | lens[0] = sizeof("SHOW") - 1; |
| 364 | |
| 365 | argv[1] = job_id; |
| 366 | lens[1] = strlen(job_id); |
| 367 | |
| 368 | build_request(argc, argv, lens); |
| 369 | const redis_result* rr = run(); |
| 370 | if (rr == NULL) |
| 371 | return NULL; |
| 372 | |
| 373 | job_ = NEW disque_job; |
| 374 | if (!job_->init(*rr)) { |
| 375 | delete job_; |
| 376 | job_ = NULL; |
| 377 | return NULL; |
| 378 | } |
| 379 | return job_; |
| 380 | } |
| 381 | |
| 382 | int disque::ackjob(const std::vector<string>& job_ids) |
| 383 | { |