Class: Wayfarer::Networking::Pool
- Inherits:
-
Object
- Object
- Wayfarer::Networking::Pool
- Includes:
- Singleton
- Defined in:
- lib/wayfarer/networking/pool.rb
Instance Method Summary collapse
Instance Method Details
#free ⇒ Object
25 26 27 |
# File 'lib/wayfarer/networking/pool.rb', line 25 def free pool.shutdown(&:renew) end |
#pool ⇒ Object
13 14 15 16 17 |
# File 'lib/wayfarer/networking/pool.rb', line 13 def pool @pool ||= ConnectionPool.new(size: Wayfarer.config.network.pool_size, timeout: Wayfarer.config.network.pool_timeout, &method(:context)) end |
#with(&block) ⇒ Object
19 20 21 22 23 |
# File 'lib/wayfarer/networking/pool.rb', line 19 def with(&block) pool.with(&block) rescue ConnectionPool::TimeoutError => e raise Wayfarer::UserAgentTimeoutError, e end |