<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Playing around at the moment, and missing something about the threading situation as it pertains to sending events.&#160;<br />
<br />
In my&#160;<span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);">ServerSentEventConnectionCallback</span>:<br />
<br />
public void connected(ServerSentEventConnection connection, String lastEventId) {<br />
try {<br />
&#160; for (int i = 0; i&lt;10; i++){<br />
&#160; &#160; connection.send("i="+i);
<div>&#160; &#160; Thread.sleep(1000);<br />
&#160; }<br />
} catch (Exception e) {<br />
&#160; throw new RuntimeException(e);<br />
}<br />
}<br /></div>
<div><br /></div>
<div>Sending events, with one second between each. &#160;</div>
<div><br /></div>
<div>I’d expect the time between events to be reflected in the browser / client. &#160;However what instead happens is all 10 events arrive within the same millisecond (nanoseconds apart according to Chrome console time).</div>
<div><br /></div>
<div>So I’m missing something here. &#160;But I don’t see anything obvious. &#160;For example, there is nothing like a “flush()” on ServerSentEventConnection that could be used after each event is sent.</div>
<div><br /></div>
<div>Ideas/guidance?</div>
<div><br /></div>
<div>Thanks!</div>
<div><br /></div>
<div>Ryan</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br /></div>
</body>
</html>