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.
精彩评论