Search for a template / approach / suggestion for working with long-term work tied to a web application

I am working on a web application for users who need to perform a lengthy background process tied to each client request. In the long run, I mean 1 to 3 minutes.

Here is an example thread. The object / widget really does not matter.

  • The client comes to the site and indicates the object / widget that they are looking for.
  • We do a search / cleanup / filter for widgets that match some source criteria. <- long process
  • The client further sets up more detailed information about the widgets they are looking for.
  • When the shutdown process is completed, the client can take the last few steps before conversion.

Steps 3 and 4 are not very important. I just mention them because we can buy some time while we do a lengthy process.

The environment in which we work is a LAMP stack - PHP is currently in use. This is not like a good design, so that a lengthy process takes up the apache stream in mod_php (or the fastcgi process). The apache level of our application should be focused on serving content, and not on IMO processing.

A few questions:

  • Do we think that we should separate this “long” part from the apache / web application level?
  • Is there a standard / typical way to abort this in Linux / Apache / MySQL / PHP (we can use a different language for processing if necessary)?
  • Any suggestions on how to deal with this? For instance. do we create a deamon that gets off through the FIFO queue?

: , 1/4 . . , , , .

!

+3
6

AJAX - . , - .

: 1-3 . , , ? - - , ?

+1

Jonnii, . :

  • ,
  • ,

, , ( , ) , , , , .

, , , .

, , - (, )

+1

:

exec ("/usr/bin/php long_running_process.php > /dev/null &");

:

  • , .

  • , .

0

Java- .

. java:

, :

  • Java JMS.

  • JMS, . , Unix .

0

Java . - - . PHP.

0

, , AJAX - , PHP (C, ++, #), PHP , , .

-1
source

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


All Articles