Beanstalk\Command\Put Class Ref

class Beanstalk\Command\Put
Extends:Beanstalk\Command
Description:The “put” command is for any process that wants to insert a job into the queue
Author:Joshua Dechant <jdechant@shapeup.com>

Class Methods

Beanstalk\Command\Put::__construct($message[, $priority = 65536, $delay = 0, $ttr = 120])
Description:

Constructor

Parameters:
  • $message (mixed) – Message to put in the beanstalkd queue
  • $priority (integer) – Job priority.
  • $delay (integer) – Number of seconds to wait before putting the job in the ready queue.
  • $ttr (integer) – Time to run. The number of seconds to allow a worker to run this job.
Beanstalk\Command\Put::getCommand()
Description:Get the command to send to the beanstalkd server
Returns:string
Beanstalk\Command\Put::getData()
Description:Get the data to send to the beanstalkd server with the command
Returns:string
Beanstalk\Command\Put::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 Id of the inserted job

Throws:

BeanstalkException When the server runs out of memory

Throws:

BeanstalkException When the job body is malformed

Throws:

BeanstalkException When the job body is larger than max-job-size in the server

Throws:

BeanstalkException When any other error occurs