Class: Mongo::Server::ConnectionPool::Populator Private

Inherits:
Object
  • Object
show all
Includes:
BackgroundThread
Defined in:
lib/mongo/server/connection_pool/populator.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A manager that maintains the invariant that the size of a connection pool is at least minPoolSize.

Since:

  • 2.0.0, largely rewritten in 2.9.0

Constant Summary

Constants included from Loggable

Loggable::PREFIX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BackgroundThread

#run!, #running?, #stop!

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger

Constructor Details

#initialize(pool, options = {}) ⇒ Populator

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Populator.

Parameters:

Options Hash (options):

  • :logger (Logger)

    A custom logger to use.

Since:

  • 2.0.0, largely rewritten in 2.9.0



32
33
34
35
36
# File 'lib/mongo/server/connection_pool/populator.rb', line 32

def initialize(pool, options = {})
  @pool = pool
  @thread = nil
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0, largely rewritten in 2.9.0



38
39
40
# File 'lib/mongo/server/connection_pool/populator.rb', line 38

def options
  @options
end

Instance Method Details

#pre_stopObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0, largely rewritten in 2.9.0



40
41
42
# File 'lib/mongo/server/connection_pool/populator.rb', line 40

def pre_stop
  @pool.populate_semaphore.signal
end