Click here to Skip to main content
15,868,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have an Azure Table Storage where data is expected to be inserted from a web service.

My App (ASP.Net MVC , VS 2017) has SignalR implemented to receive any changed data from Azure Table Storage.

My Problem

After a new data arrives in Table Storage, only if I refresh a browser, the latest data automatically gets reflected in any other opened browsers - either in same or different computer systems.It doesn't automatically display the changed value in any opened browser as soon new data gets into Table Storage. I guess this may be because when I refresh the browser, as per my code it gets the data from Table and SignalR fires to send the data to other clients.

So there is a gap here in sending notification from the Table whenever new data arrives.

My Query

What is that I am missing here - it doesn't show the latest data on the browser automatically?
Or is it that Table Storage do not have any notification mechanism to notify new-data-arrived? If so what should be done receive notification whenever a new data arrives into Azure Table Storage?

What I have tried:

My Action Method
[HttpGet]
    public ActionResult Index()
    {
        var model = SignalRepository.LatestSignalCollection();// Connects with Azure to fetch the latest 5 records
        return View(model);

    }


My SignalR Hub Code
C#
public SignalHub()
    {
        SignalRepository.SignalSubscriber();
        var signalData = SignalRepository.LatestSignalCollection(); //LatestSignalCollection() ===>  Connects with Azure to fetch the latest 5 records
        GetAllClients().All.SendSignalData(signalData);

    }



My js file - SignalR Connect code

C#
var signalHub = $.connection.signalHub; //alert("ACCC");
$.connection.hub.logging = true;
// Start the hub
$.connection.hub.start();
signalHub.client.SendSignalData = function (signalData) {
     updateSignalData(signalData);// updates the elements in Index.cshtml
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900