Module: Mongo::Session::ServerSession::Dirtyable Private
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongo/session/server_session/dirtyable.rb |
Overview
Functionality for manipulating and querying a session’s “dirty” state, per the last paragraph at github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.md#server-session-pool
If a driver has a server session pool and a network error is
encountered when executing any command with a ClientSession, the
driver MUST mark the associated ServerSession as dirty. Dirty server
sessions are discarded when returned to the server session pool. It is
valid for a dirty session to be used for subsequent commands (e.g. an
implicit retry attempt, a later command in a bulk write, or a later
operation on an explicit session), however, it MUST remain dirty for
the remainder of its lifetime regardless if later commands succeed.
Instance Attribute Summary
-
#dirty? ⇒ true | false
readonly
Internal use only
Query whether the server session has been marked dirty or not.
Instance Method Summary
-
#dirty!(mark = true)
Internal use only
Mark the server session as dirty (the default) or clean.
Instance Attribute Details
#dirty? ⇒ true
| false
(readonly)
Query whether the server session has been marked dirty or not.
# File 'lib/mongo/session/server_session/dirtyable.rb', line 38
def dirty? @dirty end
Instance Method Details
#dirty!(mark = true)
Mark the server session as dirty (the default) or clean.
# File 'lib/mongo/session/server_session/dirtyable.rb', line 46
def dirty!(mark = true) @dirty = mark end