What I've currently got can be summed up with this pseudo code:
public static void Main(string[] args)
{
var listOfObjects = Database.GetObjectsToUploadToOnlineService();
Parallel.ForEach(Upload)
}
private static void Upload(MyUploadObject obj)
{
//Build object (takes a few milliseconds)
//Format to JSON (takes a few more milliseconds)
//Upload (can take up to a max of 10 minutes)
//Wait for a response (can take up to a max of 10 minutes)
//Save response to our database (takes a few milliseconds)
}
This program is just set up on our server as a scheduled task. We own the program and can do what we want with it. My question stems from a blog about making automated monitoring checks (I don't have a link handy).
So that got me to think: How in the world can I modify my program so that I can fire up another "monitoring" program? Or should this change from being a console program to to say a WPF program that is hidden?
Overall, I would prefer to be able to just run a program on my computer that checks on the progress of the program through the network, so I don't have to RDP into the server to check on its status (but it wouldn't be the end of the world).
Overall, I suppose I would like to see a window that says something like: Process x of y so far, the following items are being processed. List the items in, like, a table and have them say like "Uploading" or "Waiting for response". Maybe if I get crazy I could also how a queue of failed items (but that would just be extra).
My mind keeps leaning towards an event, but I can't figure out how I would run a program that can subscribe and unsubscribe to a running program. Is this even possible?