开发者

Understanding Async Concept in WebServices

I've had the thrill recently of developing web service applications. Most of my开发者_JAVA技巧 experience is with GWT and mainly doing most things on the client side then doing an async call back for any additional data needed.

However at the moment, I want a process that will be triggered on the client side, then on the server side, a loop will occur, where if a certain condition is met, it will 'push' back to the client. This will hopefully remove the processor usage on the client side and also saves bandwidth. What is this called? I understand 'polling' is where the client side continuously hits a server, however what I want is the opposite. Is this possible? Am I misunderstanding what happened when I trigger an AsyncService in GWT?

Please advise.

EDIT: Just for further clarification: Having some kind of weather data service. Where, you trigger 'go' on the client side, then on the server side, it checks to see the degrees, if it has moved since last time, it will spit back the degrees to the client, if it hasn't, it will keep looping.


The term you're looking for is "long-polling" or "comet". The rocket-gwt project includes support for long-polling requests.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜