class ManqodDB
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)
Attributes
acache[R]
cache[R]
ccache[R]
connected[R]
manqod_db[R]
Public Instance Methods
connect_to_server()
click to toggle source
# File lib/Common/ManqodDB.rb, line 28 def connect_to_server einfo("connecting to #{@manqod_db_uri}","drb") @connected=false begin @manqod_db=DRb::DRbObject.new_with_uri(@manqod_db_uri) unless @manqod_db_uri.nil? @connected=@manqod_db.alive? rescue =>err Eprint.eerror("connecting failed: #{err}\n#{err.backtrace.join("\n")}","drb") end @connected end
set_manqod_db_uri(manqod_db_uri)
click to toggle source
# File lib/Common/ManqodDB.rb, line 13 def set_manqod_db_uri(manqod_db_uri) @manqod_db_uri=manqod_db_uri connect_to_server begin @cache = Memcache.new([@manqod_db.connection['cache_host']],{:prefix_key=>@manqod_db.key_name}) if connected @acache = Memcache.new([@manqod_db.admin.connection['cache_host']],{:prefix_key=>@manqod_db.admin.key_name}) if connected @ccache = Memcache.new([@manqod_db.client.connection['cache_host']],{:prefix_key=>@manqod_db.client.key_name}) if connected && manqod_db.client GtkAttributeStorage.instance.load_all rescue => err Eprint.eerror("connecting to cache failed: #{err}\n#{err.backtrace.join("\n")}","drb") end @connected end