模块:Mongo::Session::ServerSession::Dirtyable Private

包含在:
Mongo::Session::ServerSession
定义于:
lib/ Mongo/session/server_session/dirtyable.rb

Overview

该模块是私有 API 的一部分。 您应尽可能避免使用此模块,因为它将来可能会被删除或更改。

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.

由于:

  • 2.5.0

实例方法摘要折叠

实例方法详细信息

# 脏! (mark = true) ⇒ 对象

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

将服务器会话标记为脏(默认)或干净。

参数:

  • 标记 ( true | false ) (默认为: true

    是否将服务器会话标记为脏。

由于:

  • 2.5.0



46
47
48
# File 'lib/ Mongo/session/server_session/dirtyable.rb', line 46

def dirty!(标记 = true)
  @dirty = 标记
end

# 脏? true | false

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

查询服务器会话是否已被标记为脏。

返回:

  • ( true | false )

    服务器会话的脏状态

由于:

  • 2.5.0



38
39
40
# File 'lib/ Mongo/session/server_session/dirtyable.rb', line 38

def dirty?
  @dirty
end