M
M
marenco_victor2015-01-22 12:34:57
comet
marenco_victor, 2015-01-22 12:34:57

Is it possible to send real-time messages to all visitors on the site using the Push and Pull module in Bitrix?

There was a need for each site visitor to see the update of information from the database in real time. Tell me how to do it, I use the Bitrix virtual machine

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Garunovich, 2015-01-22
@evalga

I can't say for a virtual machine. But I know how to do it manually.
You can write a simple JS script that will access the PHP script via AJAX every 2 seconds, for example, and the PHP script, in turn, will look at the database and display the necessary information.

V
Viktor, 2015-01-23
@Levhav

I strongly do not recommend using a constant server poll. That every 2 seconds that once every 100 milliseconds.
This technique is called fast polling
. There is a much more competent solution, it is websocets or long polling. But not something else is better not to write in php. Since php is not suitable for this due to its single threading and high memory consumption. For implementation, you need to use the comet server , it is specially written for such tasks.
Or, to quickly get acquainted with the technology of comets, you can try SaaS comet service

T
tre, 2016-12-01
@tre

so is it possible or not?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question