Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:comet:introduction-to-comet [2017/04/20 05:02]
levhav [How push notification works]
en:comet:introduction-to-comet [2019/12/18 02:05] (current)
Line 1: Line 1:
 +<​rst>​EN::​001-Introduction::​0001-Introduction</​rst>​
 +<​rst>​Header:​ Introduction</​rst>​
 +
 ====== Introduction ====== ====== Introduction ======
  
-Comet technology ​– allows sending arbitrary messages to client through server initiative ​– it’s a push notifications. You can use push technology to delivering messages. For the correct work of push notification always use a push service. You can perform these tasks because of permanent connection between browser and Comet server. ​ Here used websocket technology. For those browsers whose don’t support websocket technology always used long polling AJAX query mechanism.+Comet technology ​— allows sending arbitrary messages to client through server initiative ​— it’s a push notifications. You can use push technology to delivering messages. For the correct work of push notification always use a push service. You can perform these tasks because of permanent connection between browser and Comet server. ​ Here used websocket technology. For those browsers whose don’t support websocket technology always used long polling AJAX query mechanism.
  
 ====== How push notification works ====== ====== How push notification works ======
Line 10: Line 13:
   - After loading this page, JavaScript establishes permanent connection with Comet server.   - After loading this page, JavaScript establishes permanent connection with Comet server.
   - While page is open, your server can send random message to client. It appeals via PHP API to server and transfer message for browser.   - While page is open, your server can send random message to client. It appeals via PHP API to server and transfer message for browser.
-  - Comet server ​uses open connection with browser. Than server delivers message to browser.+  - Comet server ​users open connection with browser. Than server delivers message to browser.
   - JavaScript API delivers this message to your callback.   - JavaScript API delivers this message to your callback.
  
-{{ :en:comet:​scheme-of-comet-using.gif |}}+{{ ::​scheme-of-comet-using.gif |}}
 ====== Advantages of using push service ====== ====== Advantages of using push service ======
  
Line 20: Line 23:
 ====== Why PHP is not available in this case? ====== ====== Why PHP is not available in this case? ======
  
-Push notifications can be implemented by PHP, but PHP need to use more memory consumption and time rate, so server will be overload. Therefore, we recommend using specified tools.+Push notifications can be implemented by PHP, but PHP need to use more memory consumption and time rate, so server will be overloaded. Therefore, we recommend using specified tools.
  
 ====== Practical use of push notifications ====== ====== Practical use of push notifications ======
Line 32: Line 35:
   * Sending messages from server to specific user (by id);   * Sending messages from server to specific user (by id);
   * Sending messages from server to all subscribers;​   * Sending messages from server to all subscribers;​
-  * Determination all of online users (who active at this moment);+  * Determination all of online users (who are active at this moment);
   * Getting statistics by real-time about summary amount of online users.   * Getting statistics by real-time about summary amount of online users.
  
-====== ​Online demo "​Sending messages from PHP" ​======+  
 +====== ​Links ======
 We recommend you to read these articles: We recommend you to read these articles:
-  ​* [[https://​github.com/​CppComet/​php-chat-example|PHP chat example]] ​ + 
 +  * [[en:​comet:​simple-php-chat-example|PHP chat example]] ​  
 +  * [[en:​comet:​javascript_api|JavaScript API]] 
 +  * [[en:​comet:​cometql|CometQL API]]  
 +  ​* [[https://​github.com/​CppComet/​comet-server|CppComet]]  
 +  * [[en:​comet:​cometql-bash-example|An example ​of sending a message from a bash script]]