Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Execute time consuming tasks as late as possible in a request

branch: master

Procrastinator for PHP: do stuff later Build Status Dependency Status

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);}

Something went wrong with that request. Please try again.