开发者

How to poll for status on client side

I need to find out status of an object which can change at any time. Best case scenario is if the object changes the client side gets updated, however I don't think there is plumbing for push开发者_如何学Pythoning updates to client-side without client-side asking for it first.

So, I'm thinking of implementing polling via jQuery ajax call that is set to a call server every 5 sec or so. Is this a reasonable solution?


Best case scenario is if the object changes the client side gets updated, however I think there is plumbing for pushing updates to client-side without client-side asking for it first.

You may checkout SignalR which will allow you to achieve PUSH notifications to clients. As a result of this the traffic will be greatly reduced and your application will be very optimized.

So, I'm thinking of implementing polling via jQuery ajax call that is set to a call server every 5 sec or so. Is this a reasonable solution?

Yes of course, that's the classic polling technique if you don't want to do PUSH.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜