GearmanBundle
🚫 (This project is no longer maintained.), (*1)
Simpliest Gearman php-extension integration with Dependency Injection Container of Symfony 2, (*2)
Installation
Before installation
At first you should install PECL Extension for Gearman.
See instruction [here][1]., (*3)
Installation with Composer
{
"require": {
"litgroup/gearman-bundle": "dev-master"
}
}
Enable bundle in the AppKernel
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new LitGroup\Bundle\GearmanBundle\LitGroupGearmanBundle(),
);
// ...
return $bundles;
}
// ...
}
Configuration
With empty configuration localhost server will be used on default port., (*4)
You can also specify the list of servers. Look on examples for yaml
, xml
and php
configurations:, (*5)
lit_group_gearman:
servers:
- "10.0.0.1"
- "10.0.0.2:4703" # Specify the port
<gearman:config
xmlns:gearman="http://litgroup.ru/schema/dic/gearman"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://litgroup.ru/schema/dic/gearman http://litgroup.ru/schema/dic/gearman/gearman-1.0.xsd">
<gearman:servers>
<gearman:server>10.0.0.1:4703</gearman:server>
<gearman:server>10.0.0.2:4703</gearman:server>
</gearman:servers>
</gearman:config>
$container->loadFromExtension('lit_group_gearman', [
'servers' => [
'10.0.0.1:4703',
'10.0.0.2:4703',
]
]);
Usage
Bundle provides two services available in container., (*6)
-
litgroup_gearman.client
— GearmanClient
class;
-
litgroup_gearman.worker
— GearmanWorker
class.
License
This bundle is under the MIT license. See the complete license in the bundle:, (*7)
Resources/meta/LICENSE
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker., (*8)
Pull request should be sent for develop
branch., (*9)