How would I create a long running process in C#?
This may seem very elementary, but I don't really have any experience in
this realm - all my experience has been on the web side of things.
I need to create a process of some sort that will repeatedly query an API
(around 5 times a second), get the results from the API (in JSON format),
and then my process will do what it needs to do with the results (in my
case, insert them into a SQL database). These details don't really matter
to the scope of the question I have, I just want to give you an idea on
what I'm trying to achieve in case someone wants to recommend a better way
of doing it.
My first thought was to create a console app that basically never quits
(unless I specifically tell it to). Is a console app the way to go for
this? The idea is I'll have a VM set up which will host my solution,
including this "process" I create. I'm not all too familiar with Windows
Services, or Windows Tasks, but I probably need to write some custom code
so therefore I imagine I can't use the Windows Task Scheduler, am I right?
No comments:
Post a Comment