Having two sequential steps running within a windows service

30 views Asked by At

I have a requirement which currently I am doing within two separate windows service. First one, makes a REST api call and writes to db and keeps doing so every 30 sec by putting it through a thread.sleep. Another windows service queries the db for the retrieved records from the REST call and processes them and this one also keeps doing so every 30 sec by putting through a thread.sleep. How can I efficiently brings these two logic together into a single windows service taking into consideration, all the possible scenarios that could go wrong like REST call could fail, or write to db could fail or record processing logic could fail. I am still a newbie with async. I tried making the first windows service async call a WPF service but did not have much luck with it.

How do I proceed?

0

There are 0 answers