|
/**
- The
use command is for producers. Subsequent put commands will put
- jobs into the tube specified by this command. If no use command has
- been issued,jobs will be put into the tube named
default.
-
- @param string $tube A name at most 200 bytes. It specifies the tube to
- use. If the tube does not exist,it will be created.
- @return string|boolean
false on error otherwise the name of the tube.
*/
public function useTube($tube) {
$this->_write(sprintf('use %s',$tube));
$status = strtok($this->_read(),' ');
switch ($status) {
case 'USING':
return strtok(' ');
default:
$this->_error($status);
return false;
}
}
/**
- Pause a tube delaying any new job in it being reserved for a given time.
-
- @param string $tube The name of the tube to pause.
- @param integer $delay Number of seconds to wait before reserving any more
- jobs from the queue.
- @return boolean
false on error otherwise true.
*/
public function pauseTube($tube,$delay) {
$this->_write(sprintf('pause-tube %s %d',$tube,$delay));
$status = strtok($this->_read(),' ');
switch ($status) {
case 'PAUSED':
return true;
case 'NOT_FOUND':
default:
$this->_error($status);
return false;
}
}
/ Worker Commands / (编辑:网站开发网_安阳站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|