Permalink
Browse files

Document breaking API change, fixes #424

  • Loading branch information...
mperham committed Jan 10, 2014
1 parent f5d9963 commit 57be77e4c9901fa79b63512070123d112f600b1d
Showing with 8 additions and 6 deletions.
  1. +2 −0 History.md
  2. +4 −4 lib/dalli/cas/client.rb
  3. +2 −2 lib/dalli/client.rb
View
@@ -4,6 +4,8 @@ Dalli Changelog
2.7.0
==========
+- BREAKING CHANGE:
+ Dalli::Client#add and #replace now return a truthy value, not boolean true or false.
- Multithreading support with dalli\_store:
Use :pool\_size to create a pool of shared, threadsafe Dalli clients in Rails:
```ruby
View
@@ -33,7 +33,7 @@ def get_multi_cas(*keys)
##
# Set the key-value pair, verifying existing CAS.
- # Returns the resulting CAS value if succeeded, and false otherwise.
+ # Returns the resulting CAS value if succeeded, and falsy otherwise.
def set_cas(key, value, cas, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:set, key, value, ttl, cas, options)
@@ -42,17 +42,17 @@ def set_cas(key, value, cas, ttl=nil, options=nil)
##
# Conditionally add a key/value pair, verifying existing CAS, only if the
# key already exists on the server. Returns the new CAS value if the
- # operation succeeded, or false otherwise.
+ # operation succeeded, or falsy otherwise.
def replace_cas(key, value, cas, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:replace, key, value, ttl, cas, options)
end
# Delete a key/value pair, verifying existing CAS.
- # Returns true if succeeded, and false otherwise.
+ # Returns true if succeeded, and falsy otherwise.
def delete_cas(key, cas=0)
perform(:delete, key, cas)
end
end
-end
+end
View
@@ -105,15 +105,15 @@ def set(key, value, ttl=nil, options=nil)
##
# Conditionally add a key/value pair, if the key does not already exist
- # on the server. Returns true if the operation succeeded.
+ # on the server. Returns truthy if the operation succeeded.
def add(key, value, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:add, key, value, ttl, options)
end
##
# Conditionally add a key/value pair, only if the key already exists
- # on the server. Returns true if the operation succeeded.
+ # on the server. Returns truthy if the operation succeeded.
def replace(key, value, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:replace, key, value, ttl, 0, options)

0 comments on commit 57be77e

Please sign in to comment.