module Mongo::ClusterTime::Consumer

This module provides common cluster time tracking behavior.

@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.

Attributes

cluster_time[R]

The cluster time tracked by the object including this module.

@return [ nil | ClusterTime ] The cluster time.

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

@since 2.5.0

Public Instance Methods

advance_cluster_time(new_cluster_time) click to toggle source

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

@param [ BSON::Document ] new_cluster_time The new cluster time document.

@return [ ClusterTime ] The resulting cluster time.

@since 2.5.0

# File lib/mongo/cluster_time.rb, line 130
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