Beanstalk\Command\Touch Class Ref

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

The “touch” command allows a worker to request more time to work on a job. This is useful for jobs that potentially take a long time, but you still want the benefits of a TTR pulling a job away from an unresponsive worker. A worker may periodically tell the server that it’s still alive and processing a job (e.g. it may do this on DEADLINE_SOON).

Class Methods

Beanstalk\Command\Touch::__construct($id)
Description:

Constructor

Parameters:
  • $id (integer) – The job id to touch
Beanstalk\Command\Touch::getCommand()
Description:Get the command to send to the beanstalkd server
Returns:string
Beanstalk\Command\Touch::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:

boolean True if command was successful

Throws:

BeanstalkException When the job cannot be found or has already timed out

Throws:

BeanstalkException When any other error occurs