hypejunction/hypeshutdown

This package is abandoned and no longer maintained. No replacement package was suggested.

Flushes the buffer after the response is sent allowing shutdown to continue in the background

1.0.3 2018-04-20 08:01 UTC

This package is not auto-updated.

Last update: 2020-02-15 14:17:19 UTC


README

API to offset code execution until system shutdown. Allows plugins to execute expensive code until after the page has been rendered in the browser.

Usage

All shutdown event handlers will be executed after the request has been sent to the browser and the buffer has been flushed.

You can either register a shutdown event handler:

elgg_register_event_handler('shutdown', 'system', function() {
	// your long running script
});

You can also use a runtime queue:

\hypeJunction\Shutdown\Queue::instance()->queue(function() use ($video) {
	$video->convert();
});