baohan / request
A helper to validate and build query criteria for MongoDB.
dev-master
2016-09-22 10:10 UTC
Requires
- php: ^5.5.9
- baohan/collection: 1.0.*
This package is auto-updated.
Last update: 2019-12-31 00:33:58 UTC
README
A job dispatcher based on swoole
Install
Install swoole
first.
composer update baohan/swoole-job
How
Quick start
$router = new \baohan\SwooleJob\Router(); $router->setPrefix("\\App\\Job\\"); $router->setExecutor("execute"); $router->setDecode(function($data) { return json_decode($data, true); }); $serv = new \baohan\SwooleJob\Server($router); $serv->setSwoolePort(9505); // custom callback event $serv->setEvtStart(function($serv) { echo "server start!" . PHP_EOL; }); $serv->start();
Configure
Event callbacks