On 13 September 2013 01:55, Richard Johnson <[email protected]>wrote:

> When separate thread calls flush(), we need to notify Jetty somehow, that
> it needs to start calling onWritePossible again.


Richard,

have a look at
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DataRateLimitedServlet.java?h=jetty-9.1

This is a filter that limits the data rate being sent, so after some writes
it decides that it needs to sleep (asynchronously) for a while.

When the scheduler calls back after the pause, we just call onWritePossible
from that thread.  But we make sure that onWritePossible always calls
isReady() before every write (and does not assume that the first write is
OK).

cheers



-- 
Greg Wilkins <[email protected]>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to