arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 125 forks source link

Update the README about exceptions #196

Closed casperisfine closed 3 years ago

casperisfine commented 3 years ago

I was trying to update https://github.com/Shopify/memcached_store to use this new version, and initially didn't realize that memcached no longer raises exceptions on NotFound etc.

I also delete a disabled test as it's really misleading.

@dylanahsmith

dylanahsmith commented 3 years ago

initially didn't realize that memcached no longer raises exceptions on NotFound etc.

Seems like anyone making the transition is likely to run into the same problem. It can also introduce ambiguity between a nil value and not found. I wonder if we should introduce a default keyword argument that can be used to disambiguate between these values and to have something to backport to 1-0-stable that can make it easier to support both 2.x and 1.9.y versions.

casperisfine commented 3 years ago

that can make it easier to support both 2.x and 1.9.y versions.

I don't think its worth it. memcached_store require memcached ~> 1.8, so it would be simpler to just do a full transition.

Also another thing I discovered is that 2.x removed the cas method. I suppose we'll have to add it back.

dylanahsmith commented 3 years ago

Also another thing I discovered is that 2.x removed the cas method. I suppose we'll have to add it back.

2.x was a rewrite that just wasn't finished. This missing feature was listed in TODO.org so was meant to be added back.

casperisfine commented 3 years ago

Ah I didn't notice that.