Skip to content

Commit

Permalink
Add the HTTP/2 connection (#1859)
Browse files Browse the repository at this point in the history
Motivation:

To build up a subchannel we need the notion of a connection to a
backend as a building block. The connection provides a single HTTP/2
connection to the remote peer and doesn't deal with backoff or
reconnects.

Modifications:

- Add the 'Connection' object which provides multiplexed streams to a
  connected backend
- Add a 'connector' API which provides a NIO channel and a multiplexer
  on which streams can be created
- Add test Utilities and tests

Result:

Can create a connection to a backend and run streams on it.
  • Loading branch information
glbrntt committed Apr 22, 2024
1 parent bdb7458 commit ec685b3
Show file tree
Hide file tree
Showing 11 changed files with 1,209 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import NIOCore
import NIOHTTP2

/// An event which happens on a client's HTTP/2 connection.
enum ClientConnectionEvent: Sendable, Hashable {
enum CloseReason: Sendable, Hashable {
@_spi(Package)
public enum ClientConnectionEvent: Sendable, Hashable {
public enum CloseReason: Sendable, Hashable {
/// The server sent a GOAWAY frame to the client.
case goAway(HTTP2ErrorCode, String)
/// The keep alive timer fired and subsequently timed out.
Expand Down
Loading

0 comments on commit ec685b3

Please sign in to comment.