Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty-9.1 -- ServletOutputStream.isReady() -- how much data can be written without blocking?

Hi,

On Thu, Sep 12, 2013 at 5:55 PM, Richard Johnson
<johnson.richard78@xxxxxxxxx> wrote:
> Thank you very much, Simone and Greg, you completely clarified this part for
> me.
>
> Now I'm stuck with a different problem.
>
> I have a queue of output data chunks that is being filled out by a
> completely
> separate thread, not related to the servlet container.
>
> After adding some data, this thread calls flush() to send all collected data
> to the client.
>
> In the beginning data queue is empty, so onWritePossible that was called
> when we first
> register ReadListener, exists.

WriteListener.
You meant "exits" ?

> When separate thread calls flush(), we need to notify Jetty somehow, that it
> needs to start calling onWritePossible again.
> (in NIO terms - "register interest in writing").
>
> How can we do that?

You call onWritePossible() from flush() from your flusher thread.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top