Class: Apnotic::ConnectionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/apnotic/connection_pool.rb

Class Method Summary collapse

Class Method Details

.development(options = {}, pool_options = {}) ⇒ Object

Raises:

  • (LocalJumpError)


18
19
20
21
22
23
24
25
26
# File 'lib/apnotic/connection_pool.rb', line 18

def development(options={}, pool_options={})
  raise(LocalJumpError, "a block is needed when initializing an Apnotic::ConnectionPool") unless block_given?

  ::ConnectionPool.new(pool_options) do
    connection = Apnotic::Connection.development(options)
    yield(connection)
    connection
  end
end

.new(options = {}, pool_options = {}) ⇒ Object

Raises:

  • (LocalJumpError)


8
9
10
11
12
13
14
15
16
# File 'lib/apnotic/connection_pool.rb', line 8

def new(options={}, pool_options={})
  raise(LocalJumpError, "a block is needed when initializing an Apnotic::ConnectionPool") unless block_given?

  ::ConnectionPool.new(pool_options) do
    connection = Apnotic::Connection.new(options)
    yield(connection)
    connection
  end
end