ASP.NET MVC 3 real time events.

╄→гoц情女王★ 提交于 2019-12-12 03:18:09

问题


I'm looking for advice regarding asp.net mvc 3 support for real time events display and handling. The typical scenario would be events like startup,shutdown, soft-reset, cache complete etc, issued on the the server and displayed immediately in the brower app, in near real time.

What is the typical mechanism to support real time events in asp.net mvc 3? Is there a listener mechanism similar to WPF event handing, or would I need to poll for them using AJAX.

I'm not planning to use any external or third pary applications to handle the events, like e.g. Pusher.

Bob.


回答1:


I am unaware of any built-in listener mechanism similar to WPF event handling.

In the past, I've had success with Ajax-polling. I implemented a thread-safe queue-based TraceListener which I would use to log events when they occurred, and on the poll action dequeue all of the backed-up trace logs.



来源:https://stackoverflow.com/questions/9055651/asp-net-mvc-3-real-time-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!