baohan / request
A helper to validate and build query criteria for MongoDB.
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/baohan/request
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