$callable will be executed after the response has been sent to the client.
This is useful for expensive operations which do not need to send
anything to the client.
At the first call to defer, deferring will be "activated". This means that
output buffering is enabled, keepalive disabled and user-abort is ignored.
You can check to see if deferring is enabled by doing a truth check on
gb::$deferred. The event "did-activate-deferring" is also posted.
Use deferring wth caution.
A good example of when delayed execution is a good idea, is how the
email-notification plugin defers the mail action (this is actually part of
GBMail but this plugin makes good use of it).
Events:
- "did-activate-deferring"
Posted when defer is activated.
static public defer ( $callable ) |