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
We now have a number of adapters 2 redis, memcached, file, etc... If we built a good active support cache adapter it would work for all the traditional cache stores and AS::Cache has a file store as well as SolidCache which is a DB adapter so we would work for postgres, mysql, and sqlite (eventually).
This could reduce the number of custom adapters we need to maintain and possibly reduce the complexity.
It might not work for the HashRedisStore adapter which relies on LUA, so I would need to figure something out for that use case or rework how we use our cache store to not need the two very different methods coverband currently uses for coverage and storage.
The text was updated successfully, but these errors were encountered:
I explored this for an hour. I'm not able and not sure how to proceed, here are my findings:
Adding an ActiveSupport::Cache adapter itself is kind of straightforward (I copied and modified the Redis adapter and its tests)
Configuring the store in config/coverband.rb is not straightforward, because Rails.cache does not exist at loading time (config.store = Coverband::Adapters::ActiveSupportCacheStore.new(Rails.cache)). Putting it in the initializer works fine.
Some other components, like view tracking, directly depend on the redis store (raw_store). So we probably not only need a new adapter, users can choose, but also rework some of the trackers. With ActiveSupport offering most of the current stores/adapters by default, it could be fine to make it the new default. But that would also be a very breaking change. https://api.rubyonrails.org/classes/ActiveSupport/Cache.html
yeah it would definitely take some effort which is why I haven't had time for it. You are likely correct that it would end up being a breaking change... instead of raw_store with sets it would likely need to just serialize into JSON and use simple gets and sets so it might also be a bit slower....
Thanks for looking at it, I do hope to get back to this sometime.
We now have a number of adapters 2 redis, memcached, file, etc... If we built a good active support cache adapter it would work for all the traditional cache stores and AS::Cache has a file store as well as SolidCache which is a DB adapter so we would work for postgres, mysql, and sqlite (eventually).
This could reduce the number of custom adapters we need to maintain and possibly reduce the complexity.
It might not work for the HashRedisStore adapter which relies on LUA, so I would need to figure something out for that use case or rework how we use our cache store to not need the two very different methods coverband currently uses for coverage and storage.
The text was updated successfully, but these errors were encountered: