laures [
http://community.jboss.org/people/laures] created the discussion
"How to implement long polling/server push with JBoss"
To view the discussion, visit:
http://community.jboss.org/message/567706#567706
--------------------------------------------------------------
Hi,
i want to use http server push / long polling / whatever its called right now, in my next
webservice.
one way (a very bad, non scaling way) to do that is like this:
@WebService(serviceName="mywebservice")
@Stateless
public class MyWebService {
@WebMethod
public String longPoll() {
short ct = 0;
while(someCondition == false && ct < 60) {
sleep(1000); // 1 sec
ct++;
}
if (someCondition)
return "got value";
else
return "";
}
}
As i said, this dowsn't scale, but should demonstrate what i want to do. I've been
looking for an alternative way and found two interesting things:
* i can create an asyncronous response with servlets:
http://docs.jboss.org/resteasy/docs/1.0.2.GA/userguide/html/Asynchronous_...
http://docs.jboss.org/resteasy/docs/1.0.2.GA/userguide/html/Asynchronous_...
but i would like to use stateless session beans for my webservice (its so nice and
simple....)
* Somebody pointed me at the APR Connector for jboss and mentioned it could do what i
want. unfortuantely i couldn't find any examples for apr, so i don't know if thats
correct (and if it is, how it would be done)
I hope you can point me in the right direction.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/567706#567706]
Start a new discussion in JBoss Web Services at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]