Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6838733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:37:57+00:00 2026-05-26T23:37:57+00:00

How would one use SignalR to implement notifications in an .NET 4.0 system that

  • 0

How would one use SignalR to implement notifications in an .NET 4.0 system that consists of an ASP.NET MVC 3 application (which uses forms authentication), SQL Server 2008 database and an MSMQ WCF service (hosted in WAS) to process data? The runtime environment consists of IIS 7.5 running on Windows Server 2008 R2 Standard Edition.

I have only played with the samples and do not have extensive knowledge of SignalR.

Here is some background

The web application accepts data from the user and adds it to a table. It then calls an one way operation (with the database key) of the WCF service to process the data (a task). The web application returns to a page telling the user the data was submitted and they will be notified when processing is done. The user can look at an “index” page an see which tasks are completed, failed or are in progress. They can continue to submit more tasks (which is independent of previous data). They can close their browser and come back later.

The MSMQ based WCF service reads the record from the database and processes the data. This may take anything from milliseconds to several minutes. When its done processing the data, the record is updated with the corresponding status (error or fail) and results.

Most of the time, the WCF service is not performing any processing, however when it does, users generally want to know when its done as soon as possible. The user will still use other parts of the web application even if they don’t have data to be processed by the WCF Service.

This is what I have done

In the primary navigation bar, I have an indicator (similar to Facebook or Google+) for the user to notify them when the status of tasks has changed. When they click on it, they get a summary of what was done and can then view the results if they wish to.

Using jQuery, I poll the server for changes. The controller action checks to see if there is any processes that were modified (completed or failed) and return them otherwise waits a couple of seconds and check again without returning to the client. In order to avoid a time out on the client, it will return after 30 seconds if there was no changes. The jQuery script waits a while and tries again.

The problems

Performance degrades with every user that views a page. There is no need for them to do anything in particular. We’ve noticed that memory usage of Firefox 7+ and Safari increases over time.

Using SignalR

I’m hoping that switching to SignalR can reduce polling and thus reduce resource requirements especially if nothing has changed task wise in the database. I have trouble getting the WCF service to notify clients that its done with processing a task given the fact that it uses forms based authentication.

By asking this question, I hope someone will give me better insight how they will redesign my notification scheme using SignalR, if at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:37:58+00:00Added an answer on May 26, 2026 at 11:37 pm

    If I understand correctly, you need a way of associating a task to a given user/client so that you can tell the client when their task has completed.

    SignalR API documentation tells me you can call JS methods for specific clients based on the client id (https://github.com/SignalR/SignalR/wiki/SignalR-Client). In theory you could do something like:

    1. Store the client id used by SignalR as part of the task metadata:
    2. Queue the task as normal.
    3. When the task is processed and de-queued:
      • Update your database with the status.
      • Using the client id stored as part of that task, use SignalR to send that client a notification:

    You should be able to retrieve the connection that your client is using and send them a message:

    string clientId = processedMessage.ClientId //Stored when you originally queued it.
    IConnection connection = Connection.GetConnection<ProcessNotificationsConnection>();
    connection.Send(clientId, "Your data was processed");
    

    This assumes you mapped this connection and the client used that connection to start the data processing request in the first place. Your “primary navigation bar” has the JS that started the connection to the ProcessNotificationsConnection endpoint you mapped earlier.

    EDIT: From https://github.com/SignalR/SignalR/wiki/Hubs

    public class MyHub : Hub
    {
         public void Send(string data)
         {
         // Invoke a method on the calling client
         Caller.addMessage(data);
    
         // Similar to above, the more verbose way
         Clients[Context.ClientId].addMessage(data);
    
         // Invoke addMessage on all clients in group foo
         Clients["foo"].addMessage(data);
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SignalR in an ASP.Net Web Application project and am having issues.
Why would one use realloc() function to resize an dynamically allocated array rather than
Why would one use func( const Class &value ) rather than just func( Class
Why would one use a functional language in an otherwise Imperative project?
Why one would use one of the following packages instead of the other? Java
When would one choose to use Rx over TPL or are the 2 frameworks
I am looking for a good explanation of why one would use sliding expiration
To support multiple platforms in C/C++, one would use the preprocessor to enable conditional
How would one write a regular expression to use in Python to split paragraphs?
And why would I use one over the other in my code?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.