locked
SignalR to be used as API scheduling RRS feed

  • Question

  • User1665947227 posted

    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?

    Tuesday, May 30, 2017 4:02 PM

Answers

  • User1967761114 posted

    Hi Underground,

    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.

    https://msdn.microsoft.com/en-us/library/system.timers.timer(v=vs.110).aspx

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 31, 2017 7:20 AM

All replies

  • User1325410084 posted

    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.

    Tuesday, May 30, 2017 6:19 PM
  • User1967761114 posted

    Hi Underground,

    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.

    https://msdn.microsoft.com/en-us/library/system.timers.timer(v=vs.110).aspx

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 31, 2017 7:20 AM
  • User1325410084 posted

    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.

    Wednesday, May 31, 2017 1:19 PM
  • User1665947227 posted

    Thanks for the feedback. I have opted to using a schedule based api calls rather than using signalr unconventionally.

    Thursday, June 1, 2017 5:44 PM