Server Push"

From Documentation
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
  
HTTP is a request-and-response protocol. Technically, there is no way to have the server to actively ''push'' data to the client. However, there are [http://en.wikipedia.org/wiki/Push_technology a few approaches] to emulate ''push'' -- it is also called Ajax Push. These approaches could be summarized in two categories, client polling and comet<ref>More precisely, it is so-called long polling.</ref>, that are both supported in ZK.
+
HTTP is a request-and-response protocol. Technically, there is no way to have the server to actively ''push'' data to the client. However, there are [http://en.wikipedia.org/wiki/Push_technology a few approaches] to emulate ''push'' -- it is also called Ajax Push. We can summarize these approaches in 2 categories:
 +
# client polling and  
 +
# comet<ref>More precisely, it is so-called long polling.</ref>
 +
 
 +
They are both supported in ZK.
  
 
Different approaches have different pros and cons, and we will discuss them in the [[ZK Developer's Reference/Server Push/Configuration|Configuration]] section.
 
Different approaches have different pros and cons, and we will discuss them in the [[ZK Developer's Reference/Server Push/Configuration|Configuration]] section.
  
No matter which implementation you choose, the use is the same. The [[ZK Developer's Reference/Server Push/Event Queues|Event Queue]] is the high-level API, and this is a suggested approach for its simplicity. However, if you prefer to access the low-level API directly, you could refer to the [[ZK Developer's Reference/Server Push/Asynchronous Tasks|Asynchronous Tasks]] and [[ZK Developer's Reference/Server Push/Synchronous Tasks|Synchronous Tasks]]  sections, depending on whether you task can be executed asynchronously.
+
No matter which implementation you choose, the usage is the same. The [[ZK Developer's Reference/Server Push/Event Queues|Event Queue]] is the high-level API, and this is a suggested approach for its simplicity. However, if you prefer to access the low-level API directly, you could refer to the [[ZK Developer's Reference/Server Push/Asynchronous Tasks|Asynchronous Tasks]] and [[ZK Developer's Reference/Server Push/Synchronous Tasks|Synchronous Tasks]]  sections, depending on whether your task can be executed asynchronously.
  
 
{{ZKDevelopersReferenceHeadingToc}}
 
{{ZKDevelopersReferenceHeadingToc}}

Revision as of 10:24, 6 July 2020

HTTP is a request-and-response protocol. Technically, there is no way to have the server to actively push data to the client. However, there are a few approaches to emulate push -- it is also called Ajax Push. We can summarize these approaches in 2 categories:

  1. client polling and
  2. comet[1]

They are both supported in ZK.

Different approaches have different pros and cons, and we will discuss them in the Configuration section.

No matter which implementation you choose, the usage is the same. The Event Queue is the high-level API, and this is a suggested approach for its simplicity. However, if you prefer to access the low-level API directly, you could refer to the Asynchronous Tasks and Synchronous Tasks sections, depending on whether your task can be executed asynchronously.




  1. More precisely, it is so-called long polling.


Last Update : 2020/07/06

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.