Do things as late as possible in a request. Don’t let your users wait

0.8.0 2017-02-26 22:46 UTC

This package is auto-updated.

Last update: 2024-06-16 05:08:21 UTC


Procrastinator for PHP: do stuff later

Gitter Build Status Dependency Status Average time to resolve an issue 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

$procrastinator = new \Procrastinator\DeferralManager(
    new \Procrastinator\Scheduler\OnRegisterShutdownScheduler(),
    new \Procrastinator\Executor\Decorator\PhpFpmExecutorDecorator(
        new \Procrastinator\Executor\SingleThreadExecutor()

// The rough way
    new \Procrastinator\Deferred\CallbackDeferred(
        'some name',
        function() {sleep(10);}

// Or use the more convenient builder interface
        ->name('some other name')
        ->call(function() {sleep(10);}