123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Operation::CausalConsistencySupported Private

Overview

Custom behavior for operations that support causal consistency.

Since:

  • 2.5.2

Instance Method Summary

Instance Method Details

#apply_causal_consistency!(selector, connection) (private)

Adds causal consistency document to the selector, if one can be constructed.

This method overrides the causal consistency addition logic of SessionsSupported and is meant to be used with operations classified as "read and write operations accepting a read concern", as these are defined in the causal consistency spec. For write operations this attaches only afterClusterTime (no read concern level) so that causal ordering is preserved across writes in a causally consistent session.

In order for the override to work correctly the CausalConsistencySupported module must be included after SessionsSupported module in target classes.

Since:

  • 2.5.2

[ GitHub ]

  
# File 'lib/mongo/operation/shared/causal_consistency_supported.rb', line 39

def apply_causal_consistency!(selector, connection)
  apply_causal_consistency_if_possible(selector, connection)
end