Echo Event Handling"

From Documentation
(Created page with "{{ZATSEssentialsPageHeader}} Since 1.1.0 {{ZATSEssentialsPageHeader}} {{ZATSEssentialsPageFooter}}")
 
m (correct highlight (via JWB))
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
  Since 1.1.0
 
  Since 1.1.0
  
 +
 +
[[ZK%20Developer's%20Reference/UI%20Patterns/Long%20Operations/Use%20Echo%20Events| Echo event]] is used to implement long operations. When you send an echo event, the event won't be processed in the current execution. Rather, it is processed in the next AU request sent (echoed back) from the client. In this new release, Mimic <code>Client</code> are now capable of simulating an echo event. By default (<code>IMMEDIATE</code>), Mimic <code>Client</code> sends the echoed AU request immediately after receiving an echo event. In <code>PIGGYBACK</code> mode, Mimic <code>Client</code> will then send custom events back to server together with the next AU request instead of sending it back immediately.
 +
 +
<source lang='java' highlight='4'>
 +
public enum EchoEventMode {
 +
 +
/** immediately reply custom events back to server when receiving echo events */
 +
IMMEDIATE,
 +
 +
/** reply custom events back to server when next AU event posting */
 +
PIGGYBACK
 +
}
 +
</source>
 +
* Line 4: The default mode.
 +
 +
However, you can change the default mode by the method <javadoc directory="zats" method="setEchoEventMode(org.zkoss.zats.mimic.EchoEventMode)" >org.zkoss.zats.mimic.Client</javadoc>
  
  

Latest revision as of 02:54, 18 January 2022

Echo Event Handling



Since 1.1.0


Echo event is used to implement long operations. When you send an echo event, the event won't be processed in the current execution. Rather, it is processed in the next AU request sent (echoed back) from the client. In this new release, Mimic Client are now capable of simulating an echo event. By default (IMMEDIATE), Mimic Client sends the echoed AU request immediately after receiving an echo event. In PIGGYBACK mode, Mimic Client will then send custom events back to server together with the next AU request instead of sending it back immediately.

public enum EchoEventMode {

	/** immediately reply custom events back to server when receiving echo events	 */
	IMMEDIATE,

	/** reply custom events back to server when next AU event posting */
	PIGGYBACK
}
  • Line 4: The default mode.

However, you can change the default mode by the method Client.setEchoEventMode(EchoEventMode)




Echo Event Handling




Last Update : 2022/01/18

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