Class: Moped::PromiscuousQueryWrapper::PromiscuousReadOperation

Inherits:
Promiscuous::Publisher::Operation::NonPersistent show all
Includes:
PromiscuousHelpers
Defined in:
lib/promiscuous/publisher/operation/mongoid.rb

Instance Attribute Summary

Attributes inherited from Promiscuous::Publisher::Operation::NonPersistent

#instances

Attributes inherited from Promiscuous::Publisher::Operation::Base

#operation

Instance Method Summary collapse

Methods inherited from Promiscuous::Publisher::Operation::NonPersistent

#execute_instrumented, #operation_payloads

Methods inherited from Promiscuous::Publisher::Operation::Base

_acquire_lock, #acquire_op_lock, #dependencies_for, #dependency_for_op_lock, #ensure_op_still_locked, #execute, #execute_instrumented, #explain_operation, #generate_payload, #get_new_op_lock, #increment_dependencies, lock_options, #on_rabbitmq_confirm, #operation_payloads, #payload_for, #publish_payload_in_rabbitmq_async, #publish_payload_in_redis, rabbitmq_staging_set_key, #record_timestamp, #recover_db_operation, recover_locks, recover_operation, recover_operation_from_lock, recover_payloads_for_rabbitmq, #recovering?, #recovery_payload, register_recovery_mechanism, #release_op_lock, run_recovery_mechanisms, #trace_operation, #write_dependencies

Constructor Details

#initialize(options = {}) ⇒ PromiscuousReadOperation

Returns a new instance of PromiscuousReadOperation.



203
204
205
206
207
# File 'lib/promiscuous/publisher/operation/mongoid.rb', line 203

def initialize(options={})
  super
  @operation = :read
  @query = options[:query]
end

Instance Method Details

#query_dependenciesObject



209
210
211
212
# File 'lib/promiscuous/publisher/operation/mongoid.rb', line 209

def query_dependencies
  deps = dependencies_for(get_selector_instance)
  deps.empty? ? super : deps
end

#should_instrument_query?Boolean

Returns:

  • (Boolean)


214
215
216
# File 'lib/promiscuous/publisher/operation/mongoid.rb', line 214

def should_instrument_query?
  super && model
end