diff --git a/.gitignore b/.gitignore index ea446f4..aa336a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea .DS_Store build cache.properties @@ -6,4 +7,4 @@ composer.lock phpunit.xml vendor composer.phar -downloads +downloads \ No newline at end of file diff --git a/src/PHPQueue/Backend/Beanstalkd.php b/src/PHPQueue/Backend/Beanstalkd.php index 1556409..2a968bc 100644 --- a/src/PHPQueue/Backend/Beanstalkd.php +++ b/src/PHPQueue/Backend/Beanstalkd.php @@ -24,15 +24,22 @@ public function __construct($options=array()) } } + /** + * + */ public function connect() { $this->connection = new \Pheanstalk\Pheanstalk($this->server_uri); } + /** - * @deprecated - * @param array $data - * @return boolean Status of saving + * @param array $data + * @param int $DEFAULT_PRIORITY + * @param int $DEFAULT_DELAY + * @param int $DEFAULT_TTR + * @return bool + * @throws BackendException */ public function add($data=array(), $DEFAULT_PRIORITY=1024, $DEFAULT_DELAY=0, $DEFAULT_TTR=60) { @@ -40,9 +47,14 @@ public function add($data=array(), $DEFAULT_PRIORITY=1024, $DEFAULT_DELAY=0, $DE return true; } + /** - * @param array $data - * @return integer Primary ID of the new record. + * @param mixed $data + * @param int $DEFAULT_PRIORITY + * @param int $DEFAULT_DELAY + * @param int $DEFAULT_TTR + * @return mixed + * @throws BackendException */ public function push($data, $DEFAULT_PRIORITY=1024, $DEFAULT_DELAY=0, $DEFAULT_TTR=60) { @@ -80,6 +92,11 @@ public function pop() return json_decode($newJob->getData(), true); } + /** + * @param null|integer $jobId + * @return bool + * @throws JobNotFoundException + */ public function clear($jobId=null) { $this->beforeClear($jobId); @@ -92,6 +109,11 @@ public function clear($jobId=null) return true; } + /** + * @param null|integer $jobId + * @return bool + * @throws JobNotFoundException + */ public function release($jobId=null) { $this->beforeRelease($jobId);