baohan / remote
A remote client based on Guzzle 6
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/baohan/remote
Requires
- php: ^5.5.9
- baohan/collection: 1.0.1
- guzzlehttp/guzzle: 6.*
- kevinrob/guzzle-cache-middleware: 1.4.*
This package is auto-updated.
Last update: 2025-09-29 01:46:58 UTC
README
A multi-processes worker framework based on Swoole and Gearman
Install
Install swoole
and gearman
first.
How
Quick start
$worker = new \baohan\SwooleGearman\Queue\Worker(); $worker->addCallback('user::created'); $worker->addCallback('user::updated'); $router = new \baohan\SwooleGearman\Router(); $router->setPrefix("\\App\\Job\\"); $router->setExecutor("execute"); $router->setDecode(function($payload) { return \json_decode($payload, true); }); $worker->addRouter($router); $serv = new \baohan\SwooleGearman\Server($worker); $serv->setSwoolePort(9505); // custom callback event $serv->setEvtStart(function($serv) { echo "server start!" . PHP_EOL; }); $serv->start();
Configure
Event callbacks