passing timers to connection, thereby giving them the possibility to set timer events

This commit is contained in:
HoneyryderChuck 2020-03-08 00:33:03 +00:00
parent 926ad27011
commit 7fb548db6b
2 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,8 @@ module HTTPX
attr_reader :origin, :state, :pending, :options
attr_writer :timers
def initialize(type, uri, options)
@type = type
@origins = [uri.origin]

View File

@ -51,6 +51,7 @@ module HTTPX
def init_connection(connection, _options)
resolve_connection(connection)
connection.timers = @timers
connection.on(:open) do
@connected_connections += 1
end