Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lstrojny/Procrastinator
Execute time consuming tasks as late as possible in a request
https://github.com/lstrojny/Procrastinator
Last synced: 3 months ago
JSON representation
Execute time consuming tasks as late as possible in a request
- Host: GitHub
- URL: https://github.com/lstrojny/Procrastinator
- Owner: lstrojny
- Created: 2012-02-05T12:59:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-26T22:55:34.000Z (over 7 years ago)
- Last Synced: 2024-03-21T21:24:03.064Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 50.8 KB
- Stars: 64
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-php-zh_CN - Procrastinator - 一个运行耗时任务的库 (杂项 Miscellaneous)
- awesome-php-cn - 官网
- awesome-php - Procrastinator - A library for running time consuming tasks. (Miscellaneous)
- awesome-php-cn - 官网
- awesome-php-new - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
- awesome-php - Procrastinator - A library for running time consuming tasks. (Miscellaneous)
- awesome-php - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
- awesome-php - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
- PHP_awesome-directus-duh-REKT-iss- - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
- awesome-stripe - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
- awesome-php - Procrastinator - A library for running time consuming tasks. (Configuration / Miscellaneous)
README
# Procrastinator for PHP: do stuff later
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lstrojny/Procrastinator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://secure.travis-ci.org/lstrojny/Procrastinator.svg)](http://travis-ci.org/lstrojny/Procrastinator) [![Dependency Status](https://www.versioneye.com/user/projects/523ed7e0632bac1b0b00b265/badge.png)](https://www.versioneye.com/user/projects/523ed7e0632bac1b0b00b265) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/lstrojny/procrastinator.svg)](http://isitmaintained.com/project/lstrojny/procrastinator "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/lstrojny/procrastinator.svg)](http://isitmaintained.com/project/lstrojny/procrastinator "Percentage of issues still open")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
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();
```