c# - Making this httpHandler more robust? -
I have the following HttpHandler; Without the need to choose a browser, I'm using it to push the updates of the browser (where jQuery and GroU UI are being applied). I think what I have accomplished is taking the polling station to the server.
Can anyone tell me how can I make this class more robust and scalable?
Here is the code
Public class LiveUpdates: IHttpHandler {// TODO: Replace it with a repository that can enter the application. Private stationary readonly dictionary & lt; String, qu parent $. Rising UI ('message', '{0}'); & lt; / script & gt; , The message); // is not buffered to the response server. Response.Flush ();} Public Static Zero Qw Update (IPrincipal User, String Update Message) {If (updated! QUU.ContenceKey (user.indenti. Name)) {updateQueue.Add (user.indenti.name, new query & lt; string & gt; ());} Update Queue [User.Identity.Name] .Enqueue (UpdateMessage);} Public Static Zero Clearupdates (Ipernist User) {if (UpdateQueConnectIn (user.indenti.name)) Update.query (user.indenti.name); }
If you type Thread.Sleep ()
, you Or your handler will not scale.
Comments
Post a Comment