Class: Mongo::Server::Populator Private

Inherits:
Object
  • Object
show all
Includes:
BackgroundThread
Defined in:
build/ruby-driver-master/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

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



31
32
33
34
35
# File 'build/ruby-driver-master/lib/mongo/server/connection_pool/populator.rb', line 31

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



37
38
39
# File 'build/ruby-driver-master/lib/mongo/server/connection_pool/populator.rb', line 37

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



39
40
41
# File 'build/ruby-driver-master/lib/mongo/server/connection_pool/populator.rb', line 39

def pre_stop
  @pool.populate_semaphore.signal
end