Class: Promiscuous::Publisher::Operation::NonPersistent
- Defined in:
- lib/promiscuous/publisher/operation/non_persistent.rb
Direct Known Subclasses
ActiveRecord::Base::PromiscousOperation, Moped::PromiscuousQueryWrapper::PromiscuousReadOperation
Instance Attribute Summary collapse
-
#instances ⇒ Object
XXX As opposed to atomic operations, NonPersistent operations deals with an array of instances.
Attributes inherited from Base
Instance Method Summary collapse
- #execute_instrumented(db_operation) ⇒ Object
-
#initialize(options = {}) ⇒ NonPersistent
constructor
A new instance of NonPersistent.
- #operation_payloads ⇒ Object
- #query_dependencies ⇒ Object
Methods inherited from Base
_acquire_lock, #acquire_op_lock, #dependencies_for, #dependency_for_op_lock, #ensure_op_still_locked, #execute, #explain_operation, #generate_payload, #get_new_op_lock, #increment_dependencies, lock_options, #on_rabbitmq_confirm, #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, #should_instrument_query?, #trace_operation, #write_dependencies
Constructor Details
#initialize(options = {}) ⇒ NonPersistent
Returns a new instance of NonPersistent.
6 7 8 9 |
# File 'lib/promiscuous/publisher/operation/non_persistent.rb', line 6 def initialize(={}) super @instances = [:instances].to_a end |
Instance Attribute Details
#instances ⇒ Object
XXX As opposed to atomic operations, NonPersistent operations deals with an array of instances
4 5 6 |
# File 'lib/promiscuous/publisher/operation/non_persistent.rb', line 4 def instances @instances end |
Instance Method Details
#execute_instrumented(db_operation) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/promiscuous/publisher/operation/non_persistent.rb', line 11 def execute_instrumented(db_operation) db_operation.call_and_remember_result(:instrumented) unless db_operation.failed? trace_operation end end |
#operation_payloads ⇒ Object
19 20 21 22 |
# File 'lib/promiscuous/publisher/operation/non_persistent.rb', line 19 def operation_payloads return [] if self.failed? @instances.map { |instance| payloads_for(instance) } end |
#query_dependencies ⇒ Object
24 25 26 |
# File 'lib/promiscuous/publisher/operation/non_persistent.rb', line 24 def query_dependencies @instances.map { |instance| dependencies_for(instance) } end |