Module: Mongo::ClusterTime::Consumer Private
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongo/cluster_time.rb |
Overview
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
-
#cluster_time ⇒ nil | ClusterTime
readonly
Internal use only
The cluster time tracked by the object including this module.
Instance Method Summary
-
#advance_cluster_time(new_cluster_time) ⇒ ClusterTime
Internal use only
Advance the tracked cluster time document for the object including this module.
Instance Attribute Details
#cluster_time ⇒ nil
| 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.
# 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.
# 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