Hello. Do not tell me, except by checking the timer with an Ajax, is it impossible to find out about the changes on the server (in the database)?

We make a system for dispatchers - a desktop on ExtJS and completely on Ajax. On the main page, ordinary users will leave requests and would like to immediately notify with a pop-up message. But these applications will be very rare, so the timer is inappropriate.

P.S. I read somewhere about requests, the answer to which comes when an answer appears. Type of request sent, and the answer will come when it changes. (I dreamed it?)

Comes to mind on option 1 (together should give effect):
1. When downloading from the server, the presence of new orders is checked.
2. In each server response (on any request) add to the end, for example: "is_new_request": true / false and check for each response processing.

P.P.S. APACHE + PHP

  • For this, there are WebSocket or Long Polling technologies - alexandr
  • And you have the opportunity to run php as a demon, without restrictions on the execution time? - ReinRaus
  • @brute, and apache + php is able to? Or can “special” servers do this? P.S. Thanks anyway. Now I know where to dig. - Ray
  • @ReinRaus, I doubt that the hoster will allow it. - Ray
  • Apache is not supported, for this you need to run separate php processes, for example Dklab Realplexor for Long Polling or Ratchet for web sockets, phpDaemon is also there, it supports both technologies. - alexandr

0