Infinite long polling |
[eluser]Unknown[/eluser]
Hello people! I'm doing some ajax long polling request on a page of my website, when i call this page it launches a new thread asynchronously. The problem is, when i leave this page, the thread obviously continues its execution, and when i go back to this page, it launches a new one. So my question is, how can a stop the execution of the thread when i leave the page that is executing it ? I cannot set a timeout since it is a long polling request. Here is my code : The javascript in my client view: Code: [removed] And the controller "operation" called : Code: function reload(){ Thanks for your help
[eluser]Unknown[/eluser]
Pardon my ignorance, i don't know what you had in mind or if i made an obvious mistake writing the post but i don't think the problem comes from the ajax part. Canceling the request will not cancel the php loop. Here is a similar thread on stackoverflow that might explain my problem better. However i would like to stop my loop whenever the view is not visible. Thanks |
Welcome Guest, Not a member yet? Register Sign In |