Hi,
can anybody explain me the functionality of the background actions of the extension ‘runactions’ in detail?
I havent got a clue to implement such a function generally.
In the documentation i could find just the following code which doesnt help me to understand whats going on.
public function actionTimeConsumingProcess()
{
if (ERunActions::runBackground())
{
//do all the stuff that should work in background
//mail->send() ....
}
else
{
//this code will be executed immediately
//echo 'Time-consuming process has been started'
//user->setFlash ...render ... redirect,
}
}
Where should i put this function? Within my controller? In the next step i thought i simply call the function normally. But obviously i was wrong:-) nothing happend and only the else part was executed. So in my next attempt i call my function with the help of:
ERunActions::runAction('bookmark/TimeConsumingProcess',$params=array(),$ignoreFilters=true,$ignoreBeforeAfterAction=true,$logOutput=false,$silent=false);
but…nothing happend. Although the false part has been executed again.
so, i gave this method a chance
ERunActions::touchUrlExt($url,$postData=null,$contentType=null,$httpClientConfig=array());
which should triggered my background job code in the if part. But in this case nothing happened at all. Even the else part has been omitted.
So, as you guess, my proramming skills are really far away from average:-)
Can anybody help me to explain me the basic functionality of this extension when i’m going to execute code in the background.
sorry for my bad english. thanks for any advice.
greets
Thorsten