pmg / pheanstalk-bundle
一个简单的集成Pheanstalk与Symfony的包
v5.0.0
2024-01-26 16:02 UTC
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-09-18 22:05:53 UTC
README
一个极其简单的Symfony包,将一个或多个Pheanstalk连接放入您的Symfony应用程序中。
如果您正在寻找功能更全的包,请查看LeezyPheanstalkBundle。
安装
1. 下载包
composer require pmg/pheanstalk-bundle
2. 启用包
<?php // app/AppKernel class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new PMG\PheanstalkBundle\PmgPheanstalkBundle(), ]; // ... return $bundles; } // ... }
配置
默认情况下,包会在容器中提供名为pmg_pheanstalk
的一个Pheanstalk\Pheanstalk
实例。它连接到默认的localhost
主机和11300
端口。
单个连接示例
# 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 https://php.ac.cn/manual/en/function.pfsockopen.php persist: false
多个连接
# 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
统计端点
此包包含一些基本的端点,返回有关队列管道的JSON数据。每个端点还允许提供connection
参数。如果没有提供,则使用默认连接。
启用端点
将以下行添加到您的routing.xml
文件中。(或等效的YML文件)
<import resource="@PmgPheanstalkBundle/Resources/config/routing.yml"> <default key="_format">json</default> </import>
可用端点
[GET] /{tube}
- 提供关于给定管道的beanstalkd所有信息[GET] /
- 提供关于beanstalkd中所有管道的所有信息