coverband icon indicating copy to clipboard operation
coverband copied to clipboard

Add memcached adapter

Open prastamaha opened this issue 11 months ago • 1 comments

Description

This pull request introduces a new adapter for Coverband, enabling the use of Memcached as a storage backend. This addition allows users of Coverband to leverage the distributed memory object caching system, which can be particularly useful for applications that are already using Memcached for other forms of caching. This can help in maintaining consistency in the tools used across an application and can potentially improve performance for coverage data storage and retrieval.

Changes

  • New File: lib/coverband/adapters/memcached_store.rb

Usage

To use the Memcached adapter, users need to initialize it with a Memcached client instance and optionally specify a namespace for the keys. This flexibility allows for easy integration into existing projects that might already be using Memcached.

Coverband.configure do |config|
    memcached = Memcached.new([...])
    config.store = Coverband::Adapters::MemcachedStore.new(memcached, memcached_namespace: 'my_app_coverband')
           
    config.track_views = false
end

Notes

Unsupported Operations: raw_store and migrate

prastamaha avatar Mar 04 '24 16:03 prastamaha

Nice, adding memcache support has been on my list for awhile now. I will take a closer look and likely pull this in... I have more been moving towards implementing a generic active support cache store adapter for Coverband which would allow folks to configure anything active support cache supports to use with Coverband.

danmayer avatar Mar 04 '24 22:03 danmayer

I am looking to get this integrated as it is taking me way longer to wrap up my other PR and I won't get to the active support adapter that soon.

danmayer avatar Apr 02 '24 02:04 danmayer

thanks so much @prastamaha I am so sorry it took me so long to get back to you on this

danmayer avatar Apr 02 '24 03:04 danmayer