mirror of
https://github.com/swift-server/async-http-client.git
synced 2026-05-03 07:32:29 +00:00
c65b2ae297
* Introduce helper methods for test of ConnectionsState Motivation: Issue #234 highlights that we directly manipulate ConnectionsState and this commit prepares tests to be refactored to manipulate the state by exposed APIs instead. Modifications: * introduce helper methods in ConnectionPoolTestsSupport.swift Result: * no observable changes * Move Connection tests out of ConnectionsState tests into separate file. Motivation: Clean up of code to address issue #234 - here we move away connection tests to separate files outside of ConnectionsState tests so we will be able to work on the ConnectionsState in focussed mode. Modifications: Connection tests moved to separate files. Result: No observable changes. * Gather Connection code into Connection.swift Motivation: For tests we will need a simple version of Connection, so here I gather Connection code in one place and will generify ConnectionsState on next commit. Modifications: Code of Connection is moved from multiple files into single Connections.swift. Result: All tests are passing, no observable behaviour change. * Introduce generic type ConnectionType into ConnectionsState Motivation: To rework tests of ConnectionsState we want to have a "simpler" version of Connection to be used, therefore here we convert ConnectionsState to support generic type ConnectionType. We will substitute current Connection with a test version in follow up commit. Modifications: ConnectionsState is altered to work on generic type ConnectionType instead of solid type Connection. Users of ConnectionsState are modified to provide type Connection into ConnectionType in this commit. Result: Test are passing, no observable behaviour change.
26 lines
838 B
Swift
26 lines
838 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the AsyncHTTPClient open source project
|
|
//
|
|
// Copyright (c) 2020 Apple Inc. and the AsyncHTTPClient project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of AsyncHTTPClient project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
extension HTTP1ConnectionProvider.Waiter: CustomStringConvertible {
|
|
var description: String {
|
|
return "HTTP1ConnectionProvider.Waiter(\(self.preference))"
|
|
}
|
|
}
|
|
|
|
extension HTTPClient.EventLoopPreference: CustomStringConvertible {
|
|
public var description: String {
|
|
return "\(self.preference)"
|
|
}
|
|
}
|