Search code examples
c#.netbackground-process

Program that runs in the background and wait several days for an event


I would like to write a program in C# that waits for a number of financial data to make a large move. I have a Bloomberg terminal and I know how to fetch data from Bloomberg in a C# program, with Bloomberg API.

But how can I make a program waits for a long time (several days) while running (maybe in the background) and intercepting this kind of events? Other programs I have written so far execute a list of steps, and then are closed. Is it possible to make without using too much CPU (especially because fetching data all the time from Bloomberg should use a lot of it)? How should I proceed?

Thank you for your help


Solution

  • I think there are two solutions:

    1. Write a simple windows service, which wait the time you need and fetch the data, sending data. That should not need much CPU, but maybe some I/O if you read and write a lot of data. (With a lot, i mean realy big data).

    2. You write a simple application which will be started by the Windows Task Scheduler. In the task scheduler you can say, how often your app should be executed.