Method: MemCache#incr
- Defined in:
- lib/gems/activesupport-2.2.2/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb
#incr(key, amount = 1) ⇒ Object
Increments the value for key by amount and retruns the new value. key must already exist. If key is not an integer, it is assumed to be 0.
303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/gems/activesupport-2.2.2/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb', line 303 def incr(key, amount = 1) server, cache_key = request_setup key if @multithread then threadsafe_cache_incr server, cache_key, amount else cache_incr server, cache_key, amount end rescue TypeError, SocketError, SystemCallError, IOError => err handle_error server, err end |