Creating a non-blocking process in an MVC 2 application

I came across a system setup that would allow users to:

  • Click the button to initialize the “download and archive” command, which reads the file lists via XML, pulls the files through HTTP to a local directory, archives them and saves them for downloading.
  • Get a progress bar / indicator that tells them that their "request is being processed" immediately after clicking the specified button.
  • You can send another command "download and archive", without waiting for the completion of previous requests.
  • As each download and archive command completes, the pool of completed archives should increase by one with a new archive available for download.

How should I track the current process that occurs during step 1, and how should I report the correct events / messages back to the user interface, as required for steps 2 and 4?

How does the user interface know about current processes? Magic folders and tokens in the file system? Session state? A database that is written by the process and read using the interface code?

I was wondering if this is common and has a “standard way” of implementation?

FYI, my stack:

  • ASP.NET MVC 2 on .NET 4
  • IIS 7
  • 7zip External Library for .NET
+3
source share
1 answer

, MVC-, Command ( , GUID). , ServiceBus backend- Id Commands View.

, View ( JavaScript) URI. http://www.mysite.com/asyncresults/GUID.js

GUID.js JSON, .

, 404 , . 200, JSON .

.

+2

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


All Articles