I'm currently trying to user runactions to execute processes (especially long requests) without having the user to wait. So I followed the documentation of runactions. And it says below should work. The insert statement should work while the action would still proceed.
public function actionLongProcess(){
if(ERunActions::runBackground()){
$sql = <<<EOD
insert into public.test (value) VALUES ('hehe')
EOD;
Yii::app()->db->createCommand($sql)->execute();
}else{
ChromePhp::log('hello');
}
}
Sadly, it doesn't and I don't know why, only the else part is executed. kinda clueless here.
This extension is a helper class for running actions. It makes controller actions reusable within different contexts.
Features
Run controller actions as background tasks
Configure cron jobs
'Touch' urls at remote/local servers.
Run preconfigured batchjobs or php scripts
Use builtin Http client for simple GET and POST requests (since v1.1)
Interval filter for controller actions (since v1.1)
Requirements
Developed with Yii 1.1.7
When using 'touchUrlExt' (see below) you have to install the extension ehttpclient