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 12:28 PM, Viktor Szathmáry <phraktle@xxxxxxxxx> wrote:
> Hi,
>
> Is there a non-blocking way of forcing flushing the output of a servlet?
>
> The use case is Server-Sent Events, where we’re trying to push messages to a
> large number of clients via AsyncContext. Calls to flushBuffer are blocking
> and we experience a backlog due to slow clients.

For this particular use case, sending messages to large number of
clients, CometD (https://cometd.org) is a much better solution, more
scalable, etc.

With Servlet 3.1 async I/O you might be able to avoid blocking.
Again, CometD already provides you with a transport based on Servlet
3.1 Async I/O, so you don't have to write this infrastructural code,
and you just concentrate on your business.

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


Back to the top