Skip to content

Commit

Permalink
Implementing kick-job.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuswilms committed Jun 14, 2014
1 parent 53d8a59 commit 0cd0e29
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Client.php
Expand Up @@ -488,6 +488,28 @@ public function kick($bound) {
}
}

/**
* This is a variant of the kick command that operates with a single
* job identified by its job id. If the given job id exists and is in a
* buried or delayed state, it will be moved to the ready queue of the
* the same tube where it currently belongs.
*
* @param integer $id The job id.
* @return boolean `false` on error `true` otherwise.
*/
public function kickJob($id) {
$this->_write(sprintf('kick-job %d', $id));
$status = strtok($this->_read(), ' ');

switch ($status) {
case 'KICKED':
return true;
default:
$this->_error($status);
return false;
}
}

/* Stats Commands */

/**
Expand Down

0 comments on commit 0cd0e29

Please sign in to comment.