🚫 (This project is no longer maintained.)
Simpliest Gearman php-extension integration with Dependency Injection Container of Symfony 2
At first you should install PECL Extension for Gearman. See instruction here.
{
"require": {
"litgroup/gearman-bundle": "dev-master"
}
}
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new LitGroup\Bundle\GearmanBundle\LitGroupGearmanBundle(),
);
// ...
return $bundles;
}
// ...
}
With empty configuration localhost server will be used on default port.
You can also specify the list of servers. Look on examples for yaml
, xml
and php
configurations:
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',
]
]);
Bundle provides two services available in container.
litgroup_gearman.client
—GearmanClient
class;litgroup_gearman.worker
—GearmanWorker
class.
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
Issues and feature requests are tracked in the Github issue tracker.
Pull request should be sent for develop
branch.