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();
return View(model);
}
My SignalR Hub Code
public SignalHub()
{
SignalRepository.SignalSubscriber();
var signalData = SignalRepository.LatestSignalCollection();
GetAllClients().All.SendSignalData(signalData);
}
My js file - SignalR Connect code
var signalHub = $.connection.signalHub;
$.connection.hub.logging = true;
$.connection.hub.start();
signalHub.client.SendSignalData = function (signalData) {
updateSignalData(signalData);
}