1 # -*- encoding: binary -*-
4 # MogileFS::Client is the MogileFS client base class. Concrete clients like
5 # MogileFS::MogileFS and MogileFS::Admin are implemented atop this one to do
10 # The backend connection for this client
15 attr_accessor :hosts if defined? $TESTING
19 # Creates a new Client. See MogileFS::Backend#initialize for how to specify
20 # hosts. If :readonly is set to true, the client will not modify anything
23 # MogileFS::Client.new :hosts => ['kaa:6001', 'ziz:6001'], :readonly => true
27 @readonly = args[:readonly] ? true : false
28 @timeout = args[:timeout]
29 @fail_timeout = args[:fail_timeout]
30 @connect_timeout = args[:connect_timeout]
36 # Creates a new MogileFS::Backend.
39 @backend = MogileFS::Backend.new(:hosts => @hosts,
41 :fail_timeout => @fail_timeout,
42 :connect_timeout => @connect_timeout)
46 # The last error reported by the backend.
53 # The last error message reported by the backend.
60 # Is this a read-only client?