gonzalo123 / gearmanserviceprovider
Gearman Service Provider for Silex
dev-master / 1.0.x-dev
2016-03-09 20:19 UTC
Requires
- gonzalo123/gearman: dev-master
- gonzalo123/injector: ^1.0
- silex/silex: >=v1.1.2, <2.0
This package is not auto-updated.
Last update: 2024-11-07 01:13:40 UTC
README
Silex aplication example:
use G\Gearman\Client; use G\GearmanServiceProvider; use Silex\Application; $app = new Application(); $app->register(new GearmanServiceProvider()); $app->get("/", function (Client $client) { return "Hello " . $client->doNormal("worker.example", "Gonzalo"); }); $app->run();
worker example
use G\Gearman\Builder; $worker = Builder::createWorker(); $worker->on("worker.example", function ($response) { return strrev($response); }); $worker->run();