removing resolver_ios cache from pool (did not have accurate values, not really useful since selector avoid doubler registries already)

This commit is contained in:
HoneyryderChuck 2021-09-28 15:25:05 +01:00
parent a8830681df
commit 921d1f6371
3 changed files with 18 additions and 11 deletions

View File

@ -163,4 +163,7 @@ Style/SlicingWithRange:
Performance/StringIdentifierArgument:
Exclude:
- 'test/support/websocket_test_plugin.rb'
- 'test/support/requests/plugins/upgrade.rb'
- 'test/support/requests/plugins/upgrade.rb'
Style/Lambda:
Enabled: false

View File

@ -14,7 +14,6 @@ module HTTPX
def initialize
@resolvers = {}
@_resolver_ios = {}
@timers = Timers.new
@selector = Selector.new
@connections = []
@ -111,7 +110,7 @@ module HTTPX
resolver << connection
return if resolver.empty?
@_resolver_ios[resolver] ||= select_connection(resolver)
select_connection(resolver)
end
def on_resolver_connection(connection)
@ -143,7 +142,6 @@ module HTTPX
@resolvers.delete(resolver_type)
deselect_connection(resolver)
@_resolver_ios.delete(resolver)
resolver.close unless resolver.closed?
end

View File

@ -1,14 +1,20 @@
module HTTPX
class Pool
@resolvers: Hash[Class, Resolver::Resolver]
@timers: Timers
@selector: Selector
@connections: Array[Connection]
@connected_connections: Integer
def empty?: () -> void
def next_tick: () -> void
def close: (*Array[Connection]) -> void
def close: (?Array[Connection] connections) -> void
def init_connection: (Connection, Options) -> void
def init_connection: (Connection connection, Options options) -> void
def find_connection: (generic_uri, Options) -> Connection?
def find_connection: (URI::Generic uri, Options options) -> Connection?
def deactivate: (*Array[Connection]) -> void
@ -28,13 +34,13 @@ module HTTPX
def unregister_connection: (Connection) -> void
def select_connection: (resolver | Connection connection) -> void
def select_connection: (Resolver::Resolver | Connection connection) -> void
def deselect_connection: (resolver | Connection connection) -> void
def deselect_connection: (Resolver::Resolver | Connection connection) -> void
def coalesce_connections: (Connection, Connection) -> void
def coalesce_connections: (Connection coalescable, Connection coalescing) -> void
def next_timeout: () -> Numeric?
def next_timeout: () -> (Integer | Float | nil)
def find_resolver_for: (Connection) -> Resolver::Resolver
end