Class Phalcon\Queue\Beanstalk
Class to access the beanstalk queue service. Partially implements the protocol version 1.2
<?php
use Phalcon\Queue\Beanstalk;
$queue = new Beanstalk(
[
"host" => "127.0.0.1",
"port" => 11300,
"persistent" => true,
]
);
Constants
Methods
public __construct ([array $parameters])
public connect ()
Makes a connection to the Beanstalkd server
public put (mixed $data, [array $options])
Puts a job on the queue using specified tube.
public reserve ([mixed $timeout])
Reserves/locks a ready job from the specified tube.
Change the active tube. By default the tube is "default".
The watch command adds the named tube to the watch list for the current connection.
It removes the named tube from the watch list for the current connection.
public pauseTube (mixed $tube, mixed $delay)
Can delay any new job being reserved for a given time.
The kick command applies only to the currently used tube.
public stats ()
Gives statistical information about the system as a whole.
public statsTube (mixed $tube)
Gives statistical information about the specified tube if it exists.
public listTubes ()
Returns a list of all existing tubes.
public listTubeUsed ()
Returns the tube currently being used by the client.
public listTubesWatched ()
Returns a list tubes currently being watched by the client.
public peekReady ()
Inspect the next ready job.
public peekBuried ()
Return the next job in the list of buried jobs.
public peekDelayed ()
Return the next job in the list of buried jobs.
The peek commands let the client inspect a job in the system.
final public readStatus ()
Reads the latest status from the Beanstalkd server
final public readYaml ()
Fetch a YAML payload from the Beanstalkd server
Reads a packet from the socket. Prior to reading from the socket will check for availability of the connection.
Writes data to the socket. Performs a connection if none is available
public disconnect ()
Closes the connection to the beanstalk server.
public quit ()
Simply closes the connection.