1

I understand I can do a Process.Start to execute a console app from a web application, but I'd like thoughts on how to design this project correctly.

Authenticated users can submit requests that require a console app to be executed that does some backend work (may or may not take a long time) and the results from the console app needs to be displayed to the user.

Does the Process.Start execute the console app in the same thread as the asp.net process? If so, does this 'lock' the user's browser? Should I be doing this asynchronously? If so, how is this recommended? How do I get results back from the console app?

Also, will this approach be scalable for several 100s of users submitting requests?

Any more replies?

2
  • Consider to use WCF or web service instead of console application Commented Nov 12, 2011 at 21:08
  • @YuriyRozhovetskiy Unfortunately, this console app is already created and cannot be converted into a web service Commented Nov 12, 2011 at 21:46

2 Answers 2

1

Process.Start is a non-blocking call. You can use the Process object and handle its events and read from or write to its streams.

As for if it's scalable, you might need a lot of powerful servers. It depends on the actual process.

Sign up to request clarification or add additional context in comments.

Comments

1

The common solution is to have a database table where background operation queue is stored. So, when the user submits a request, a new record is added to the queue table. Console application runs periodically (e.g. scheduled with Cron), checks the queue table in the database, executes the tasks in background and writes the results to the database.

Such an approach is very scalable and widely used.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.