Hey guys / gals,
I am starting development of a windows service and would like to consult the braintrust at stackoverflow before getting too far into it as to the best way to handle it.
This will be my first windows service and I am not really familiar with threading, which is what I am assuming will be the recommendations here (but am eager to learn!).
The service will have the following functionality on a high level:
- Monitor a folder for new files (planning to use FileSystemWatcher).
- Upon detection of a file, it is queued for upload to an external host.
- If there are files in the queue, serially HTTP POST those files to the external host.
- The files have to be POST'ed one at a time (serially) and must be transferred using HTTP POST.
- Upon successful HTTP POST, it will delete the local file and, if necessary, move to the next file in the upload queue and repeat the process.
The issue I can foresee even at this high level, is that the HTTP POST of the file to the external host could take a really long time.
What design options are available to best handle this long running aspect of the windows service? Should I be even looking at using a windows service at all as an implementation for this solution? Should I be looking into a standalone app instead?
Thanks in advance overflow'ers!