added timers gem, and a timer group to the pool

This commit is contained in:
HoneyryderChuck 2019-09-25 19:50:15 +01:00
parent 860866eb86
commit 99a221dbc9
2 changed files with 8 additions and 0 deletions

View File

@ -21,6 +21,7 @@ Gem::Specification.new do |gem|
gem.version = HTTPX::VERSION
gem.add_runtime_dependency "http-2", ">= 0.9.0"
gem.add_runtime_dependency "timers"
gem.add_development_dependency "http-form_data", ">= 2.0.0", "< 3"
gem.add_development_dependency "http-cookie", "~> 1.0"
end

View File

@ -1,14 +1,21 @@
# frozen_string_literal: true
require "forwardable"
require "timers"
require "httpx/selector"
require "httpx/connection"
require "httpx/resolver"
module HTTPX
class Pool
extend Forwardable
def_delegator :@timers, :after
def initialize
@resolvers = {}
@_resolver_monitors = {}
@timers = Timers::Group.new
@selector = Selector.new
@connections = []
@connected_connections = 0