hypejunction/hypeshutdown

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

1.0.3 2018-04-20 08:01 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();
});