Note that there are some explanatory texts on larger screens.

plurals
  1. POSynchronizing client state between SignalR and ASP.NET MVC4 (or should I even use SignalR?)
    primarykey
    data
    text
    <p><strong>Background:</strong></p> <p>Here's my project: On an ASP.NET MVC4 web app, users enter information and post to the server. The server then starts running a long task (anywhere from less than a second to 20 minutes. Usually about 4 minutes.)</p> <p>I don't want all of the work happening in the Controller action, or else the user would have to wait for it to complete with no feedback about what's going on. So I'd like to send the user to a status page and send updates from the server to that page.</p> <p><strong>Current Partial Solution:</strong></p> <p>Here's what I have so far: The Controller starts a Task with the long running action and then directs the user to the status page. As the task runs, it sends messages back to the status page with SignalR, and the page updates.</p> <p><strong>Problems:</strong></p> <ol> <li>SingalR is updating all Clients, so more than one user can't use this app at the same time. I see that SignalR has a way to send messages to specific clients, but how can I get the client ID to the Controller? SignalR makes it difficult (impossible?) to access the Session.</li> <li>What if the Task finishes before the status page loads (or what if there's a pause between updates right as the page loads?) The status page won't have any information about the Task. Again, it would be nice to store the status the Session, but I can't seem to make that work.</li> </ol> <p>Is there a way to get SignalR and ASP.NET to synchronize client state? Is SignalR the right tool for the job?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload