2

When making a GET request for a particular resource (i.e. ServerResource) if I put the thread to sleep (to simulate long-polling) what would happen? Does the framework support this? From a Java EE standpoint what are the side-effects? Does it scale well with Tomcat (or any other server?)

Has any-one tried implementing long-polling using Restlet by just making the request thread sleep?

It seems restlet has no support for comet-style web applications and hence the question of such a hack, so to speak.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
PhD
  • 11,202
  • 14
  • 64
  • 112

1 Answers1

4

Blocking a thread is possible as long as you don't need a huge number of concurrent connections in which case this will cause a scalability issue.

In version 2.1 of the Restlet Framework edition for JavaSe, the internal non-blocking NIO connector has added such capabilities (handling any number of connections with a limited thread pool) even though it isn't fully stable and documented yet.

Jerome Louvel
  • 2,882
  • 18
  • 19
  • We do need a good deal of concurrent connections - it's an internal enterprise application but we do need to 'poll' for *updates* (similar to facebook). Is there a way you suggest it be achieved? – PhD Jan 29 '12 at 19:03