To understand why we need to explicitly turn on allow_concurrency, we need to analyze the mechanisms available in Ruby and Rails to load code.
The most common form of loading code is Ruby’s require method:
Some libraries work fine by simply using require, but as they grow, some of them tend to rely on autoload techniques to avoid loading all their files up front. Autoload is particularly important in Rails plug-ins because it helps application boot time to stay low in development and test environments, since we load modules only when we first need them.
We’ve used Ruby’s autoload in this chapter with the LiveAssets::SSESubscriber class:
autoload :SSESubscriber, ...