Running session_write_close()
before sleep()
in Laravel doesn't seem to be functioning as the session is still blocked from other requests until the current connection is complete.
I'm trying to sleep()
in Laravel without blocking other requests. Found out that session_write_close() should resolve the problem as mentioned here: Long polling in Laravel (sleep() function make application freeze). But it doesn't work. sleep()
is still blocking other requests.
The project app is a chat app using regular polling and long-polling: http://github.com/doncadavona/laravel-angularjs-chat
Directly to the code: https://github.com/doncadavona/laravel-angularjs-chat/blob/master/app/Http/Controllers/MessagesController.php
Laravel doesn't use PHP's session handling functions. You must use
to call a handler's write method. But, since Laravel also doesn't implement any session locking mechanism, you are unlikely to see any session related blocking, nor should you see any change in ajax behavior because you saved/closed the session.