123456789_123456789_123456789_123456789_123456789_

Module: Mongo::ClusterTime::Consumer Private

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongo/cluster_time.rb

Overview

Note:

Although attributes and methods defined in this module are part of the public API for the classes including this module, the fact that the methods are defined on this module and not directly on the including classes is not part of the public API.

This module provides common cluster time tracking behavior.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#cluster_timenil | ClusterTime (readonly)

The cluster time tracked by the object including this module.

Changed in version 2.9.0: This attribute became an instance of ::Mongo::ClusterTime, which is a subclass of BSON::Document. Previously it was an instance of BSON::Document.

Returns:

Since:

  • 2.5.0

[ GitHub ]

  
# File 'lib/mongo/cluster_time.rb', line 123

attr_reader :cluster_time

Instance Method Details

#advance_cluster_time(new_cluster_time) ⇒ ClusterTime

Advance the tracked cluster time document for the object including this module.

Parameters:

  • new_cluster_time (BSON::Document)

    The new cluster time document.

Returns:

Since:

  • 2.5.0

[ GitHub ]

  
# File 'lib/mongo/cluster_time.rb', line 133

def advance_cluster_time(new_cluster_time)
  if @cluster_time
    @cluster_time = @cluster_time.advance(new_cluster_time)
  else
    @cluster_time = ClusterTime[new_cluster_time]
  end
end