Module: AWS::SimpleDB::ConsistentReadOption

Included in:
Attribute, AttributeCollection, Item, ItemCollection
Defined in:
lib/aws/simple_db/consistent_read_option.rb

Instance Method Summary collapse

Instance Method Details

#consistent_read(options) ⇒ Boolean

Determines if SimpleDB should be read consistently or not.

Precedence is given to:

  • :consistent_read option

  • SimpleDB.consistent_reads block value

  • AWS.config.simple_db_consistent_reads?

Returns:

  • (Boolean)

    Returns true if a read should be made consistently to SimpleDB.



30
31
32
33
34
35
36
37
38
# File 'lib/aws/simple_db/consistent_read_option.rb', line 30

def consistent_read options
  if options.has_key?(:consistent_read)
    options[:consistent_read] ? true : false  
  elsif SimpleDB.send(:in_consistent_reads_block?)
    SimpleDB.send(:consistent_reads_state)
  else
    config.simple_db_consistent_reads?
  end
end