Method: Mongo::Server::ConnectionBase#generation

Defined in:
lib/mongo/server/connection_base.rb

#generationInteger | nil

Connection pool generation from which this connection was created. May be nil.

Returns:

  • (Integer | nil)

    Connection pool generation.

Since:

  • 2.0.0



100
101
102
103
104
105
# File 'lib/mongo/server/connection_base.rb', line 100

def generation
  # If the connection is to a load balancer, @generation is set
  # after handshake completes. If the connection is to another server
  # type, generation is specified during connection creation.
  @generation || options[:generation]
end