Object
This storage allows for mixing of storage implementation or simply mixing of storage physical backend.
opts = {}
engine =
Ruote::Engine.new(
Ruote::Worker.new(
Ruote::CompositeStorage.new(
Ruote::FsStorage.new('ruote_work', opts),
'msgs' => Ruote::HashStorage.new(opts))))
In this example, everything goes to the FsStorage, except the messages (msgs) that go to an in-memory storage.
def add_type (type) end
# File lib/ruote/storage/composite_storage.rb, line 68 def delete (doc) storage(type).delete(doc) end
# File lib/ruote/storage/composite_storage.rb, line 63 def get (type, key) storage(type).get(type, key) end
# File lib/ruote/storage/composite_storage.rb, line 73 def get_many (type, key=nil, opts={}) storage(type).get_many(type, key, opts) end
# File lib/ruote/storage/composite_storage.rb, line 78 def ids (type) storage(type).ids(type) end
# File lib/ruote/storage/composite_storage.rb, line 83 def purge! TYPES.collect { |t| storage(t) }.uniq.each { |s| s.purge! } end
# File lib/ruote/storage/composite_storage.rb, line 116 def prepare_base_methods singleton = class << self; self; end STORAGE_BASE_METHODS.each do |method, type| singleton.send(:define_method, method) do |*args| storage(type).send(method, *args) end end end
Generated with the Darkfish Rdoc Generator 2.