Paul
Paul

Reputation: 467

Guide me the best way of doing a task which takes a good amount of time to complete?

In a asp.net web application we need to develop a page with following functionality:

Its a time consuming process. If we do it in main thread it may occurs times out error. Please guide me best approach to do this considering following points:

Thanks, paul

Upvotes: 1

Views: 79

Answers (2)

TehBoyan
TehBoyan

Reputation: 6890

It would probably be best if you separate your time consuming tasks in a separate service(WCF service for example). You can create a method that will process your 10,000,000 coupons and generate PDFs and you can have another to check the status of the processing while just displaying a processing icon in your web page.

There are also other alternatives as asynchronous pages in asp.net.

Upvotes: 0

p.campbell
p.campbell

Reputation: 100607

Within Your Web App

If you must do this in your ASP.NET application, consider:

Outisde Your Web App

If you'd want to move this out of your web app, you could submit a 'job' to another application like a web service or a Windows service. Simply give it the array of coupon numbers, or a file to pickup and parse.

For each coupon completed, it could drop that 'finished' flag into a database or a file to a directory, and your web application could read that for feedback to your user.

Upvotes: 1

Related Questions