Tips for a lengthy procedure in C #

I developed a program that uses Delphi, which, among some functions, does a lot of reading a database of float values ​​and many calculations on these values. At the end of these calculations, he displays a screen with some results. These calculations take some time to complete: today it’s something like 5-10 minutes, before finally showing the results screen.

Now my clients are requesting the .NET version of this program, since almost all my other programs have already gone to .Net. But I am afraid that this time-consuming calculation procedure will not correspond to the web scenario, and the program will lead to a user error for a certain time.

So, I would like to get some tips or advice on how to do this. Initially, I thought about calling a local executable (which could even be my Delphi initial program, in a console way) and after a while it displays a results screen on a web page. But, again, I'm afraid this is not the best approach.

+3
source share
4 answers

- . ASP.NET(.. new Thread()), , , , . , , , - Ajax, , .

+4

FWIW, , - (, , , ), , , - , - , .

, , - , - , , , .

+3

:

YourService.HeavyDutyCalculator svc = new YourService.HeavyDutyCalculator(); svc.Timeout = 10 * 1 * 1000; //Constitutes 10 mins, 10 mins x 1 second x 1000 ms Service.CalculateResult result = svc.Calculate();

, -1, , .

MSDN:

Timeout Timeout.Infinite , . , - XML Timeout , - - .

  • - -.
  • /inProgress
  • - OnComplete event; .

web.config:

<httpRuntime useFullyQualifiedRedirectUrl="true|false"
             maxRequestLength="size in kbytes"
             executionTimeout="seconds"
             minFreeThreads="number of threads"
             minFreeLocalRequestFreeThreads="number of threads"
             appRequestQueueLimit="number of requests"
             versionHeader="version string"/>
0

No matter what else you do, you need a progress bar or other indication of status for the user. Users are used to web pages that load in seconds, they just don’t understand (even if you tell them in advance) that they need to wait 10 minutes for their results.

0
source

Source: https://habr.com/ru/post/1761655/


All Articles