Skip to content

Commit 13e4d1a

Browse files
committed
Add comments
1 parent 2281244 commit 13e4d1a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTP1Connections.swift renamed to Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP1Connections.swift

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import NIOCore
1616

1717
extension HTTPConnectionPool {
18+
/// Represents the state of a single HTTP/1.1 connection
1819
private struct HTTP1ConnectionState {
1920
enum State {
2021
/// the connection is creating a connection. Valid transitions are to: .backingOff, .available and .failed
@@ -161,10 +162,23 @@ extension HTTPConnectionPool {
161162
}
162163

163164
/// A structure to hold the currently active HTTP/1.1 connections.
165+
///
166+
/// The general purpose connection pool (pool for requests that don't have special `EventLoop`
167+
/// requirements) will grow up until `maximumConcurrentConnections`. If requests have
168+
/// special `EventLoop` requirements overflow connections might be opened.
169+
///
170+
/// All connections live in the same `connections` array. In the front are the general purpose
171+
/// connections. In the back (starting with the `overflowIndex`) are the connections for
172+
/// requests with special needs.
164173
struct HTTP1Connections {
174+
/// The maximum number of connections in the general purpose pool.
165175
private let maximumConcurrentConnections: Int
176+
/// A connectionID generator.
166177
private let generator: Connection.ID.Generator
178+
/// The connections states
167179
private var connections: [HTTP1ConnectionState]
180+
/// The index after which you will find the connections for requests with `EventLoop`
181+
/// requirements in `connections`.
168182
private var overflowIndex: Array<HTTP1ConnectionState>.Index
169183

170184
init(maximumConcurrentConnections: Int, generator: Connection.ID.Generator) {

0 commit comments

Comments
 (0)