Module: SimpleRecord
- Defined in:
- lib/stats.rb,
lib/results_array.rb,
lib/simple_record.rb
Defined Under Namespace
Modules: Callbacks Classes: Activerecordtosdb_subrecord_array, Base, ResultsArray, SimpleRecord_errors, Stats
Constant Summary collapse
- @@stats =
SimpleRecord::Stats.new
Class Method Summary collapse
- .close_connection ⇒ Object
-
.establish_connection(aws_access_key = nil, aws_secret_key = nil, params = {}) ⇒ Object
Create a new handle to an Sdb account.
- .stats ⇒ Object
Class Method Details
.close_connection ⇒ Object
59 60 61 |
# File 'lib/simple_record.rb', line 59 def self.close_connection() RightAws::ActiveSdb.close_connection end |
.establish_connection(aws_access_key = nil, aws_secret_key = nil, params = {}) ⇒ Object
Create a new handle to an Sdb account. All handles share the same per process or per thread HTTP connection to Amazon Sdb. Each handle is for a specific account. The params are passed through as-is to RightAws::SdbInterface.new Params:
{ :server => 'sdb.amazonaws.com' # Amazon service host: 'sdb.amazonaws.com'(default)
:port => 443 # Amazon service port: 80(default) or 443
:protocol => 'https' # Amazon service protocol: 'http'(default) or 'https'
:signature_version => '0' # The signature version : '0' or '1'(default)
:connection_mode => :default # options are
:default (will use best known safe (as in won't need explicit close) option, may change in the future)
:per_request (opens and closes a connection on every request to SDB)
:single (one thread across entire app)
:per_thread (one connection per thread)
:pool (uses a connection pool with a maximum number of connections - NOT IMPLEMENTED YET)
:logger => Logger Object # Logger instance: logs to STDOUT if omitted
55 56 57 |
# File 'lib/simple_record.rb', line 55 def self.establish_connection(aws_access_key=nil, aws_secret_key=nil, params={}) RightAws::ActiveSdb.establish_connection(aws_access_key, aws_secret_key, params) end |
.stats ⇒ Object
36 37 38 |
# File 'lib/simple_record.rb', line 36 def self.stats @@stats end |