In the top of your
home/other_method
Controller for your script not to stop set:ignore_user_abort(true); set_time_limit(0);
Create stream context configuring its timeout to short time period and not to produce Exception on timeout reached:
$context = stream_create_context(array( 'http'=>array( 'timeout' => 1.0, // Set timeout to 1 second 'ignore_errors' => true // Don't prouce Exception ) ));
(Assume your
home/other_method
URL ishttp://localhost/other_method
) call your URL using context created:$kick = file_get_contents(`'http://localhost/other_method'`, false, $context);
After timeout is reached, file_get_contents()
stops returning empty string but your request will continue in the background till its end.
Beware of calling 'http://localhost/other_method'
multiple times, all those request will run concurrently.
You can create something similar using Kohana's Request_Client_External class with CURL.