Rails controllers, safely unlock the block and then come back?

Short and simple question:

fork { something_that_takes_a_few_seconds_and_doesnt_concern_the_user }

respond_to ...

Is there a reason not to do this kind of thing in a rails application? In PHP, we currently rely on external queuing systems such as beanstalk or Amazon SQS, combined with an asynchronous workflow that pulls things out of the queue to run in the background. Depending on the complexity of the task, a simple plug will work better in many cases.

+3
source share
1 answer

Yes, if you get too many requests or this process takes longer than expected, you can easily hack your processor and memory, and the Rails application will start causing errors from memory.

Rails- , Resque, , webapp, - , ( ).

, , , , (- ) .

+1

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


All Articles