No description, website, or topics provided.
PHP HTML XSLT JavaScript Shell CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
classes
doc
tests
.gitignore
.gitmodules
LICENCE
README.md
pheanstalk_init.php

README.md

Pheanstalk

Pheanstalk, created by Paul Annesley, is a pure PHP 5.2+ client for the beanstalkd workqueue. The code is rigorously unit tested and written using encapsulated, maintainable object oriented design.

All commands and responses specified in the protocol documentation for beanstalkd 1.3 are fully supported.

Usage Example


<?php

// register Pheanstalk class loader
require_once('pheanstalk_init.php');

$pheanstalk = new Pheanstalk('127.0.0.1');

// ----------------------------------------
// producer (queues jobs)

$pheanstalk
  ->useTube('testtube')
  ->put("job payload goes here\n");

// ----------------------------------------
// worker (performs jobs)

$job = $pheanstalk
  ->watch('testtube')
  ->ignore('default')
  ->reserve();

echo $job->getData();

$pheanstalk->delete($job);

?>

Running the tests



# ensure you have simpletest
$ git submodule init
$ git submodule update


$ ./tests/runtests.php
All Tests
OK
Test cases run: 4/4, Passes: 103, Failures: 0, Exceptions: 0


# extra tests relying on a beanstalkd on 127.0.0.1:11300
$ ./tests/runtests.php --with-server
All Tests
OK
Test cases run: 7/7, Passes: 198, Failures: 0, Exceptions: 0


$ ./tests/runtests.php --help

CLI test runner.

Available options:

  --with-server      Includes tests which connect to a beanstalkd server
  --testfile   Only run the specified test file.
  --help             This documentation.