Beanstalk\Command\WatchTube Class Ref

class Beanstalk\Command\WatchTube
Extends:Beanstalk\Command
Description:Watch command
Author:Joshua Dechant <jdechant@shapeup.com>

The “watch” command adds the named tube to the watch list for the current connection. A reserve command will take a job from any of the tubes in the watch list. For each new connection, the watch list initially consists of one tube, named “default”.

Class Methods

Beanstalk\Command\WatchTube::__construct($tube)
Description:

Constructor

Parameters:
  • $tube (string) – Tube to add to the watch list. If the tube doesn’t exist, it will be created
Throws:

BeanstalkException When $tube exceeds 200 bytes

Beanstalk\Command\WatchTube::getCommand()
Description:Get the command to send to the beanstalkd server
Returns:string
Beanstalk\Command\WatchTube::parseResponse($response[, $data = null, $conn = null])
Description:

Parse the response for success or failure.

Parameters:
  • $response (string) – Response line, i.e, first line in response
  • $data (string) – Data recieved with reponse, if any, else null
  • $conn (BeanstalkConnection) – BeanstalkConnection use to send the command
Returns:

integer The number of tubes being watched

Throws:

BeanstalkException When any error occurs