Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] asynchronous flush?

Hi,

On Thu, Jul 28, 2016 at 4:55 PM, Viktor Szathmáry <phraktle@xxxxxxxxx> wrote:
> Hi Joakim,
>
> I understand buffering in general :) We don’t need low latency here, the
> short SSE updates are pushed in batches every second and we can tolerate
> short delays in this (even on the order of seconds). However, without
> flushing, Jetty would continue buffering for quite a while. Apparently,
> non-blocking flush was overlooked when designing the async-write servlet
> APIs.

That, and a ton of other things ;)

> If Jetty also does not expose any calls to do this, I suppose setting
> a low buffer size on the ServletResponse then padding the writes would work.
> But it’s not very elegant :)

I don't think we have async flush, but it's a nice feature to have.
Can you file an issue about this ?

> Btw, to show you specifically what we’re talking about, this servlet feeds
> the traffic visualization shown on the map here:
> http://www.scarabresearch.com/. For this use case, SSE seems quite adequate.

Pegs the CPU at 100%.

Are you using Jetty's SSE Servlet ?
https://github.com/eclipse/jetty.project/blob/jetty-9.3.x/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/EventSourceServlet.java

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top