I'm working on an API integration project in Ruby and I was about to create a class method to somewhat follow what Rails does with the finder methods but I stopped short of doing so because I'm concerned I might introduce a race condition.
I wouldn't be storing anything within the member variables, just instantiating objects with the the class method and making external API calls, so everything would be locally scoped (within the class method). Still, isn't there a potential of having a race condition as multiple threads pass through this class method? How do the Rails finder class methods avoid this? Or am I not understanding something at a more fundamental level here?