lib/dalli/options.rb in dalli-0.9.4 vs lib/dalli/options.rb in dalli-0.9.5

- old
+ new

@@ -1,35 +1,8 @@ require 'thread' module Dalli - # Auto-marshal all values in/out of memcached. - # Otherwise, Dalli will just use to_s on all values. - # - # Dalli::Client.extend(Dalli::Marshal) - # - module Marshal - def serialize(value) - ::Marshal.dump(value) - end - - def deserialize(value) - begin - ::Marshal.load(value) - rescue TypeError - raise Dalli::DalliError, "Invalid marshalled data in memcached, this happens if you switch the :marshal option and still have old data in memcached: #{value}" - end - end - - def append(key, value) - raise Dalli::DalliError, "Marshalling and append do not work together" - end - - def prepend(key, value) - raise Dalli::DalliError, "Marshalling and prepend do not work together" - end - end - # Make Dalli threadsafe by using a lock around all # public server methods. # # Dalli::Server.extend(Dalli::Threadsafe) # \ No newline at end of file