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: 2024-12-19 01:40:52 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();