I am very confused on when to use fiber local variables over thread local variables in rails.
My use case is following:
I have a controller in rails which on a GET request does some computation and stores the result (which is a list of integers) in either fiber or thread local variable. I need to do this so that I can excess this computed result in lets say a model which might be created by controller. Now I don't want to store it in session since this computation must be done for each and every GET request. I also clear up the fiber/thread local variable just before GET method in controller completes.
Now I do see that both Fibre and Thread are quite different and hence their storage variables. Can anyone please explain when to use which kind of variable ?
Actually my understanding is as follows: it seems that two requests can never be served in same fiber/thread at the same time. Hence if I have a value that I want to put in request scope, either one should be fine. Is my explanation correct ?