Class Mongo::Server::Context
In: lib/mongo/server/context.rb
Parent: Object

Represents a context in which messages are sent to the server on a connection.

@since 2.0.0

@deprecated Will be removed in version 3.0

Methods

Attributes

server  [R]  @return [ Mongo::Server ] server The server the context is for.

Public Class methods

Instantiate a server context.

@example Instantiate a server context.

  Mongo::Server::Context.new(server)

@param [ Mongo::Server ] server The server the context is for.

@since 2.0.0

Public Instance methods

Execute a block of code with a connection, that is checked out of the pool and then checked back in.

@example Send a message with the connection.

  context.with_connection do |connection|
    connection.dispatch([ command ])
  end

@return [ Object ] The result of the block execution.

@since 2.0.0

[Validate]