Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm building a new report generator for our in-house survey system. (No I can not use any off-the-shelf software. These are highly customized reports.)

I want to use Topshelf to host the generator as a service. Our current generator is a desktop-app and requires a user to be logged in on the server. I want to try to avoid this.

The report-generation itself is very straight forward and procedural in nature. But the server is more than capable of generating several reports at one time. I want the service to spin up a few instances of the generator at the same time, is this something I would use the Task Parallel Library for? A bit of pseudo would look a bit like this:

poller.Poll(order => { // blocking(?) call to listen for new report-orders
  var gen = new Generator(order);
  gen.process(); // generates report
  set gen = null; // or something else to destroy the generator for that report

Anyone have any suggestions on how to accomplish this?

share|improve this question
how do the report-job-entries come into the database? Are they triggerd by date/time rules (a la ever tuesday at 6pm)?. The soloutions i am aware of either implement producer-consumer that react when sombody wants a report or the timer engine calculates when the next event should occur and set a timer to this. – k3b Jan 6 '14 at 19:07
The report orders come into the database on demand. Our web-interface exposes a report builder. Our customers use this to create their specific reports. I have been thinking about going the queue-route (RabbitMQ or such) but I am not able to do any major rewrites on the web application at this time. (I am doing a complete rewrite in the future though) – Christian Wattengård Jan 7 '14 at 7:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.