Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Async IO failed with IllegalStateException in HttpOutput

I see 3 things in Gregs statement...

1) you can't write until isReady() is true
2) you can only write 1 time per isReady() call
3) if isReady() is false, then you have to wait till the next onWritePossible() to do your loop again.



--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Wed, Apr 15, 2015 at 2:13 PM, Michael Aaron <maaaroooon@xxxxxxxxx> wrote:
Hello Greg,

I'm a little confused by the requirement of "After onWritePossible has been called". Shouldn't isReady() return false if onWritePossible has not been called? Why is the result of isReady() not enough to determine whether it's ok to write?

Thanks,
Michael

On Tue, Apr 14, 2015 at 10:26 PM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:


Michael,

it is not necessary that write has to be called from within onWritePossible, but it is necessary that write is called AFTER onWritePossible has been called.

For example we have a throttling app that when onWritePossible is called, it can decide to schedule a timer that will callback after a short time (in a different Thread), that thread can then just call onWritePossible itself which then loops on isReady and write until isReady returns false or all the content is written.






--
Greg Wilkins <gregw@xxxxxxxxxxx>  @  Webtide - an Intalio subsidiary
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top