2017 © Pedro Peláez
 

symfony-bundle pheanstalk-bundle

A pheanstalk-bundle for Symfony2

image

drymek/pheanstalk-bundle

A pheanstalk-bundle for Symfony2

  • Tuesday, October 8, 2013
  • by drymek
  • Repository
  • 1 Watchers
  • 12 Stars
  • 911 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Introduction:

Pheanstalk bundle is simple and easy way to use Pheanstalk2 (namespaced version of Pheanstalk) with Symfony2 applications. It's provide some usefull tool., (*1)

Install:

deps:, (*2)

[Pheanstalk]
    git=https://github.com/mrpoundsign/pheanstalk.git
    target=/pheanstalk

[drymekPheanstalkBundle]
    git=https://github.com/drymek/PheanstalkBundle.git
    target=/bundles/drymek/PheanstalkBundle

app/AppKernel.php, (*3)

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            // (...)
            $bundles[] = new drymek\PheanstalkBundle\drymekPheanstalkBundle();
        }

app/autoload.php, (*4)


$loader->registerNamespaces(array( // (...) 'Pheanstalk' => __DIR__.'/../vendor/pheanstalk/classes', 'drymek' => __DIR__.'/../vendor/bundles', ));

app/config/config.yml, (*5)

To just use the defaults (server 127.0.0.1, port 11300, timeout 3 seconds):, (*6)


drymek_pheanstalk: ~

To configure any, or all, to something other than the defaults, simply add the ones you want:, (*7)


drymek_pheanstalk: server: YOUR_SERVER port: YOUR_SERVER_PORT timeout: YOUR_CONNECTION_TIMEOUT_VALUE_IN_SECONDS

Service:

Get the Pheanstalk object to work with:, (*8)

$this->get('pheanstalk');

Developers tools:

Add to your app/config/routing_dev.yml, (*9)

_pheanstalk:
    resource: "@drymekPheanstalkBundle/Resources/config/routing.yml"
    prefix:   /_pheanstalk

Developers tools features:

  • List tubes
  • Create tube
  • List tube's jobs
  • Delete jobs
  • Put new job to tube

Usage example:

$pheanstalk = $this->get('pheanstalk');

// ----------------------------------------
// 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);

The Versions

08/10 2013

dev-master

9999999-dev https://github.com/drymek/PheanstalkBundle

A pheanstalk-bundle for Symfony2

  Sources   Download

The Requires

 

queue beanstalkd pheanstalk