Last post Jun 01, 2017 05:44 PM by codebandit
May 30, 2017 04:02 PM|codebandit|LINK
Hi I am new to SignalR. I have seen lot of examples of using signalR in combination with API as push notification events for client to notify of updated data available. Is it possible to use SignalR as an client application that schedules REST API Calls
in the case the server doesn't have any signalR service. Here is what I am trying to do. I am client that uses API provided by vendor to make calls to pull data and map it to our database. There is no way of knowing that there is new data until I make a REST
API call to check.
This is where I am thinking that the long poling feature of signalR would come in handy. Idea is to create a local executable application that uses SignalR to call the api to check if there is new data and then execute a service
(another .net executable application) that will pull the data and consume it (map it to our database).
Can this work?
May 30, 2017 06:19 PM|Underground|LINK
It's not really clear what you're trying to accomplish there, where all the pieces are.
It sounds as though you might be better served by a SQL job or SSIS package though, or whatever similar mechanism there is for your DB.
Or a dedicated Windows service. This sounds like background data synchronization, not something that would need to go through a UI.
May 31, 2017 07:20 AM|EvenMa|LINK
I feels that you’d better to use the feature of timed execution than SignalR.
SignalR is used to communicate between server and client.
In your case, you want to use SignalR to check whether there has new data on server, if there has new data, then use SignlaR to notify client.
But who drives the SignalR to check for new data on server? Where is the client?
According to your description, in this scenes I think the client and server are the same computer, So that’s not necessary to use SignalR.
You could directly use timed execution to drive to check whether there has new data.
You could use System.Timers.Timer to implement timed execution.
About how to use System.Timers.Timer, you could refer to the following code.
If you have any other questions, please feel free to contact me any time.
May 31, 2017 01:19 PM|Underground|LINK
Perhaps he can elaborate, but his description makes it sound as though he's using the UI as part of the process to get the data to a server, not the other way around. If that's the case, he's probably better off cutting the client out of it entirely.
Jun 01, 2017 05:44 PM|codebandit|LINK
Thanks for the feedback. I have opted to using a schedule based api calls rather than using signalr unconventionally.