php - Phalcon Micro Application(facing prob with finish middleware event) -


i facing problem while implementing micro application in want middle ware executed after response send browser. mentioned in documentation of phalcon finish middle ware suppose work not working, browser still waiting complete whole process return response.

my code like:

$app->before(function() use ($app, $di) { $di->get('log')->log("this message before"); $di->get('log')->close(); });  $testctrl = new testctrl(); $app->get('/ctrltest', array($testctrl, "indexaction"));  $app->after(function() use ($app, $di) {      echo "after";     $di->get('log')->log("this message after");     $di->get('log')->close(); });  $app->finish(function() use ($app, $di) {         $count = 100000;         while ($count) {`enter code here`             $di->get('log')->log("count " . $count);             $count--;         } }); 

the response coming after whole loop executed. sample code or suggestion helpful


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -