You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 15, 2022. It is now read-only.
I see that you cannot nest the usage of ThreadSafe::Cache objects in version 0.3.5 of the gem because there is a single Mutex for all instances of ThreadSafe::Cache. Looking through the git history, I see that this issue has existed since at least 2012, so if you guys don't want to fix it, that makes total sense to me.
Here's a little ruby script that demonstrates the issue.
require'thread_safe'outer=ThreadSafe::Cache.newinner=ThreadSafe::Cache.newouter.compute("seven")dothree=inner.compute("three"){3}#blows up herethree + 4end
The place where the issue comes in for me is with using Rails.cache in conjunction with a ThreadSafe::Cache as the ActiveSupport::Cache seems to use one already under the hood. I'm using Rails v4.2.
I'm planning on switching to Concurrent::Map once I upgrade my project from concurrent-ruby 0.9.2 to 1.0.0 and I can monkey patch until then.