开发者

How to poll for status on client side

开发者 https://www.devze.com 2023-04-03 20:24 出处:网络
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开发者_如

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

精彩评论

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