Browse by Tags
All Tags »
Async pages (
RSS)
After seeing the core of the real-time solution in post 1 – 4 this post will show the other code parts and specify a few details and steps we can take to optimize the solution: So here are the missing codes to complete the puzzle: The StocksValuesDB class, that simulate a DB being updated in each interval and has an event to tell clients when an update occurs: public class StocksValuesDB { //The event this DB raised when the data changes public delegate void StocksChangedDeleaget ( StocksEventArgs...
In the previous post, I explained how to use the HTTP Async handler (or simply Async page) in order to create a callback and store it somewhere. Later when something changes this callback will be invoked and update the web client waiting for update. But what is this callback ,how do we get it invoked and what is BeinXXX and EndXXX in this post: Asynchronous Programming Model: When an application performs an IO operation, the application is very much depend on the device that is doing this IO work...
In part 2 of these series of posts , I showed the basics of building the UI for the page and the JavaScript for calling the server using AJAX and waiting for a response. But how did I make the HTTP request “wait” and let the server “wake” it up? The answer is very simple. Async page (or Async HTTP Handlers). Here is a simple explanation from MSDN: “When ASP.NET receives a request for a page, it grabs a thread from a thread pool and assigns that request to the thread. A normal, or synchronous, page...
In the previous post , I wrote the general steps to accomplish the solution of achieving real time web application. In this post we will start and demonstrate the solution step by step and explain the application blocks of the solution from building the simple UI for this sample project and moving forward to the hardcode parts of the solution, so without further ado lets start. The demo code can be downloaded from here . (It is a web application solution that runs and works without a DB, but instead...
What if we could write a web application that it’s clients (browsers in our case) can get notified in case of something happening in the server, like a DB row added/changed, a BL entity (from any object model you have built ) raising an event or anything you can come up with in your mind. To clarify things let me further explain by using a very simple example : Say you have a web page (aspx, html, or any other) that displays a various stocks values in a grid, these values are changing very fast and...
Lately I have been working a lot with ASP.NET amazing feature :Asynchronous pages. Whenever the page has a lot of work in the server and he wishes to set free the thread handling this request, this is the time we need to use Async pages. I will not go into details about what Async pages are, but in a nutshell: Since there is a limit to the thread ASP.NET can use , we wish to free the long bounded thread to other thread so that they will not wait. (A good example can be: a page calling web service...