lib/asynchronic/data_store/in_memory.rb in asynchronic-1.6.1 vs lib/asynchronic/data_store/in_memory.rb in asynchronic-1.6.2
- old
+ new
@@ -10,14 +10,14 @@
@keys_mutex = Hash.new { |h,k| h[k] = Mutex.new }
self.class.connections[object_id] = self
end
def [](key)
- @hash[key.to_s]
+ Marshal.load(@hash[key.to_s]) if @hash.key? key.to_s
end
def []=(key, value)
- @mutex.synchronize { @hash[key.to_s] = value }
+ @mutex.synchronize { @hash[key.to_s] = Marshal.dump(value) }
end
def delete(key)
@hash.delete key.to_s
end
\ No newline at end of file