environment, precondition
- The authentication function (Security) is mounted. (config : firewalls)
- FOSUserBundle bundle is installed.
- The following processing is carried out in the login state.
There is simple action.
routing : demo_home_index
indexAction()
{
sleep(60);
return // ...
}
And, there is an action by which a file is read.
routing : demo_home_read
public function readAction()
{
$file = "/path/to/file/read.txt";
$contents = false;
if (file_exists($file)) {
$fp = fopen($file, 'r');
$contents = fgets($fp);
fclose($fp);
}
return new Response(json_encode(array(
'contents' => $contents,
)));
}
So, first from UI, asynchronousness, I access an indexAction. At the same time it is processing what is a interval function of file read.
$.ajax({
url : Routing.generate("demo_home_index"),
type : "GET",
dataType : 'json'
})
.done(function(response){
// This isn't returning for 60 seconds for a sleep.
console.log(response);
});
var timer = setInterval(function(){
$.ajax({
url : Routing.generate("demo_home_read"),
type : "GET",
dataType : 'json'
})
.done(function(response){
console.log(response);
});
}, 3000);
This time, interval access is suspending while first access is done. So, when the first access is completed, other access is also completed in sequence.
This happens also in normal access. (not asynchronous) While indexAction (sleep) is being processed, even if I access other action (other page) on tab browser, it's stopped. (A browser will be the loading state)
Without being stopped, is it able to process at the same time?
Does it become possible to change the setting of firewalls of Symfony2 ?
Or, does it become possible to change the setting of FOSUserBundle ?
I'm in the state by which doesn't know the cause now.
Thank you.