lstrojny/procrastinator
最新稳定版本:0.8.0
Composer 安装命令:
composer require lstrojny/procrastinator
包简介
Do things as late as possible in a request. Don’t let your users wait
README 文档
README
A few classes to help you executing complicated tasks (like sending mails) later.
Example using fastcgi_finish_request() to finish request before executing tasks
<?php $procrastinator = new \Procrastinator\DeferralManager( new \Procrastinator\Scheduler\OnRegisterShutdownScheduler(), new \Procrastinator\Executor\Decorator\PhpFpmExecutorDecorator( new \Procrastinator\Executor\SingleThreadExecutor() ) ); // The rough way $procrastinator->register( new \Procrastinator\Deferred\CallbackDeferred( 'some name', function() {sleep(10);} ) ); // Or use the more convenient builder interface $procrastinator->register( $procrastinator ->newDeferred() ->name('some other name') ->call(function() {sleep(10);} ->build() ); $procrastinator->schedule();
统计信息
- 总下载量: 32.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 63
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-06