Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Continuation and streaming

Hi jetty users!

I'd like to make a http comet streaming server with Jetty 7, for that I've looked at the documentation and for my test case I should use the "Suspend Continue Pattern". 

In my understanding, I should keep the continuation object (that contains the response) and write in it each time I have a message to send and I should also never resume or complete the connection.

Is it a pattern that you encourage to use ?

The documentation warns us about DOS problems : "If many responses are to be sent (e.g., a chat room), then writing one response may block and cause a DOS on the other responses.". If the response.write method blocks, then there is also a risk to block a thread if the client is slow and cannot read all the messages send as quickly as they are send.

But it seems that Jetty can use async processing of streams provided by NIO. Is it possible to obtain a response that uses async writes in order to avoid blocking problems ?

Please, take a little time to answer me and give your opinion.

Thanks.

jetty-users@xxxxxxxxxxx
William.

Back to the top