Class: PooledCurbDataSource

Inherits:
CommonPool::PoolDataSource
  • Object
show all
Defined in:
lib/pooled_curb_datasource.rb

Overview

PooledCurbDataSource

obtains http clients (Curl::Easy objects) through a pool.

esto es importante porque si reutilizamos los clientes HTTP (curb) tenemos alguna

usage:

http_client_pool = CommonPool::ObjectPool.new(PooledCurbDataSource.new)
curb_client = http_client_pool.borrow_object
..
http_client_pool.return_object(curb_client)

see:

http://github.com/jugend/common-pool

Instance Method Summary collapse

Instance Method Details

#create_objectObject



17
18
19
# File 'lib/pooled_curb_datasource.rb', line 17

def create_object
  Curl::Easy.new
end