I am very confused about when to use local variables of local variables with respect to local flow variables in rails. My use case:
I have a controller in rails, which, at the request of GET, performs some calculations and saves the result (which is a list of integers) both on the local and local network. I need to do this so that I can exceed this calculated result to tell the model that the controller can create. Now I do not want to store it in the session, since this calculation should be performed for each GET request. I also clear the local fib / thread variable just before the completion of the GET method in the controller.
Now I see that both Fiber and Thread are completely different and therefore are their storage variables. Can someone explain when to use which variable?
In fact, I understand the following: it seems that two requests can never be served on the same fiber / thread at the same time. Therefore, if I have a value that I want to place in the request area, then everything should be fine. Is my explanation correct?
source
share