I have a case looks like this: Here is my controller code:
//example controller:
public function runAction() {
// a example code that run a long time
$count = 0;
while (true) {
$count = $count + 1;
Mage::register('testcount', $count);
sleep(3);
}
}
public function viewAction() {
echo Mage::registry("testcount");
}
I want to view $count while "runAction" is running by using viewAction. But the viewAction loads forever. Any solution for me?
Mage::getSingleton("core/session")->setTestCount($count)
andMage::getSingleton("core/session")->getTestCount()
did not work either.