gonzalo123/gearmanserviceprovider

Gearman Service Provider for Silex

dev-master / 1.0.x-dev 2016-03-09 20:19 UTC

This package is not auto-updated.

Last update: 2020-09-16 06:04:13 UTC


README

Build Status

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();