Event Queues"

From Documentation
(Created page with '{{ZKDevelopersReferencePageHeader}} =Version History= {{LastUpdated}} {| border='1px' | width="100%" ! Version !! Date !! Content |- |   |   |   |} {{ZKDeveloper…')
 
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
 +
 +
An event queue is an event-based publish-subscribe solution for application information delivery and messaging. It provides asynchronous communications for different modules/roles in a loosely-coupled and autonomous fashion.
 +
 +
By publishing, a module (publisher) sends out messages without explicitly specifying or having knowledge of intended recipients. By subscribing, a receiving module (subscriber) receives messages that the subscriber has registered an interest in, without explicitly specifying or knowing the publisher.
 +
[[File:Eventqueue-concept.jpg]]
 +
 +
ZK generalizes the event queue to support the server push. The use is straightforward: specify the scope of a given event queue as <javadoc method="APPLICATION">org.zkoss.zk.ui.event.EventQueues</javadoc> (or <javadoc method="SESSION">org.zkoss.zk.ui.event.EventQueues</javadoc>, but rare). For example,
 +
 +
<source lang="java">
 +
EventQueue que = EventQueues.lookup("chat", EventQueues.APPLICATION, true);
 +
</source>
 +
 +
For more information about event queues, please refer to the [[ZK Developer's Reference/Event Handling/Event Queues|Event Handling: Event Queues]] section.
 +
 +
For the information about low-evel API, please refer to [[ZK Developer's Reference/Server Push/Asynchronous Tasks|Asynchronous Tasks]] section, if the task can execute asynchronously; or [[ZK Developer's Reference/Server Push/Synchronous Tasks|Synchronous Tasks]] if it must execute synchronously.
  
 
=Version History=
 
=Version History=
Line 6: Line 21:
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| &nbsp;
+
| 5.0.6
| &nbsp;
+
| November 2010
| &nbsp;
+
| The event queue won't start any working threads and they are serializable, so it is safe to use them in a clustering environment.
 
|}
 
|}
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Revision as of 10:52, 22 November 2010

An event queue is an event-based publish-subscribe solution for application information delivery and messaging. It provides asynchronous communications for different modules/roles in a loosely-coupled and autonomous fashion.

By publishing, a module (publisher) sends out messages without explicitly specifying or having knowledge of intended recipients. By subscribing, a receiving module (subscriber) receives messages that the subscriber has registered an interest in, without explicitly specifying or knowing the publisher. Eventqueue-concept.jpg

ZK generalizes the event queue to support the server push. The use is straightforward: specify the scope of a given event queue as EventQueues.APPLICATION (or EventQueues.SESSION, but rare). For example,

EventQueue que = EventQueues.lookup("chat", EventQueues.APPLICATION, true);

For more information about event queues, please refer to the Event Handling: Event Queues section.

For the information about low-evel API, please refer to Asynchronous Tasks section, if the task can execute asynchronously; or Synchronous Tasks if it must execute synchronously.

Version History

Last Update : 2010/11/22


Version Date Content
5.0.6 November 2010 The event queue won't start any working threads and they are serializable, so it is safe to use them in a clustering environment.



Last Update : 2010/11/22

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