pmg / pheanstalk-bundle
A simple bundle that integrate Pheanstalk with Symfony
Installs: 36 637
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 17
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- pda/pheanstalk: ^4.0
- symfony/console: ^5.4.34 || ^6.4
- symfony/framework-bundle: ^5.4.34 || ^6.4
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/cache: ^5.4 || ^6.4
- symfony/config: ^5.4 || ^6.4
- symfony/dependency-injection: ^5.4.5 || ^6.4
- symfony/error-handler: ^5.4 || ^6.4
- symfony/event-dispatcher: ^5.4.34 || ^6.4
- symfony/filesystem: ^5.4 || ^6.4
- symfony/finder: ^5.4 || ^6.4
- symfony/http-foundation: ^5.4.24 || ^6.4
- symfony/phpunit-bridge: ^5.4 || ^6.4
- symfony/routing: ^5.4.34 || ^6.4
- symfony/var-dumper: ^5.4 || ^6.4
- symfony/var-exporter: ^5.4 || ^6.4
- symfony/yaml: ^5.4.31 || ^6.4
This package is auto-updated.
Last update: 2024-11-18 22:40:59 UTC
README
An extremely simple Symfony bundle that puts one or more Pheanstalk connections into your Symfony application.
If you're looking for something more full featured, check out LeezyPheanstalkBundle.
Installation
1. Download the Bundle
composer require pmg/pheanstalk-bundle
2. Enable the Bundle
<?php // app/AppKernel class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new PMG\PheanstalkBundle\PmgPheanstalkBundle(), ]; // ... return $bundles; } // ... }
Configuration
By default the bundle will provide you with one Pheanstalk\Pheanstalk
named
pmg_pheanstalk
in the container. This connects to localhost
on the default
11300
port.
Single Connection Example
# Default configuration for "PmgPheanstalkBundle" pmg_pheanstalk: # The connection's host. host: localhost # The connection's port. port: 11300 # The connection's timeout. timeout: null # Whether or not to keep the connection's socket around between requests. See http://php.net/manual/en/function.pfsockopen.php persist: false
Multiple Connections
# Default configuration for "PmgPheanstalkBundle" pmg_pheanstalk: # The default connection that will be made available at the `pmg_pheanstalk` service default_connection: default connections: # use the default configuration default: ~ # another connection, will be put at the `pmg_pheanstalk.another` service another: host: anotherServier.com port: 11301
Statistic Endpoints
This bundle includes a few basic endpoints that return JSON data that provides information about the queue tubes.
Each endpoint also allows for a connection
parameter to be supplied. If it is not, the default
connection is used.
Enabling the endpoints
Add the following line to your routing.xml
file. (Or equivalent YML file)
<import resource="@PmgPheanstalkBundle/Resources/config/routing.yml"> <default key="_format">json</default> </import>
Available endpoints
[GET] /{tube}
- Provides all information from beanstalkd about the given tube[GET] /
- Provides all information about all tubes from beanstalkd