Good day. Explain, please.
Here in the php script configured for an infinite loop, I first call the messages.GetLongPollServer method, then I join the longpoll, the page loads up to 25 seconds or until it receives an event.
To check I send a message, everything comes, everything works. then I call messages.GetLongPollHistory. It works too. There further there is an event handling in a script and again a cycle on the new.
My question is: you need to handle all the events, but what to do if the message came during the processing of another event, because it does not get into the long poll connection and I cannot get it and process it, what should I do in this case?
Here is the algorithm:
while(!$stop) {
messages.getLongPollServerПодключение к long poll:http://{$server}?act=a_check&key={$key}&ts={$ts}&wait=25&mode=2(here the page loads 25 seconds, or until the event arrives)messages.getLongPollHistory- handle events
- check for a stop command
}