Skip to content

Introduce new typed HTTPClientUpgrader and WebSocketClientUpgrader#2526

Merged
Lukasa merged 2 commits intoapple:mainfrom
FranzBusch:fb-websocket-client-upgrade
Oct 6, 2023
Merged

Introduce new typed HTTPClientUpgrader and WebSocketClientUpgrader#2526
Lukasa merged 2 commits intoapple:mainfrom
FranzBusch:fb-websocket-client-upgrade

Conversation

@FranzBusch
Copy link
Copy Markdown
Member

Motivation

In my previous PR #2517, I added a new typed HTTPServerUpgrader and corresponding implementation for the WebSocketServerUpgrader. The goal of those is to carry type information across HTTP upgrades which allows us to build fully typed pipelines.

Modification

This PR adds a few things:

  1. A new NIOTypedHttpClientUpgradeHandler + NIOTypedHttpClientProtocolUpgrader. I also moved the state handling to a separate state machine. Similar to the server PR I did not unify the state machine between the newly typed and untyped upgrade handlers since they differ in logic.
  2. A new NIOTypedWebSocketClientUpgrader
  3. An overhauled WebSocket client example.

Result

This is the last missing piece of dynamic pipeline changing where we did not carry around the type information. After this PR lands, we can finalize the AsyncChannel and async typed NIO pieces.

@FranzBusch FranzBusch requested review from Lukasa and glbrntt October 2, 2023 17:09
@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from d5a4d05 to d27c1f5 Compare October 2, 2023 20:47
Copy link
Copy Markdown
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mostly nits.

@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from d27c1f5 to 33f8580 Compare October 3, 2023 14:50
@FranzBusch FranzBusch requested a review from glbrntt October 3, 2023 14:50
@FranzBusch FranzBusch added the 🆕 semver/minor Adds new public API. label Oct 3, 2023
@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from 33f8580 to 2118607 Compare October 4, 2023 16:54
Copy link
Copy Markdown
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, looks good otherwise

@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from 2118607 to 5818fc7 Compare October 5, 2023 10:02
@FranzBusch
Copy link
Copy Markdown
Member Author

@swift-server-bot test this please

@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from 5818fc7 to 9c8d9ed Compare October 5, 2023 13:56
# Motivation
In my previous PR apple#2517, I added a new typed `HTTPServerUpgrader` and corresponding implementation for the `WebSocketServerUpgrader`. The goal of those is to carry type information across HTTP upgrades which allows us to build fully typed pipelines.

# Modification
This PR adds a few things:
1. A new `NIOTypedHttpClientUpgradeHandler` + `NIOTypedHttpClientProtocolUpgrader`. I also moved the state handling to a separate state machine. Similar to the server PR I did not unify the state machine between the newly typed and untyped upgrade handlers since they differ in logic.
2. A new `NIOTypedWebSocketClientUpgrader`
3. An overhauled WebSocket client example.

# Result
This is the last missing piece of dynamic pipeline changing where we did not carry around the type information. After this PR lands, we can finalize the `AsyncChannel` and async typed NIO pieces.
@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from 9c8d9ed to 7b0a2c1 Compare October 5, 2023 18:33
@FranzBusch FranzBusch force-pushed the fb-websocket-client-upgrade branch from 7b0a2c1 to 014031a Compare October 5, 2023 18:42
@FranzBusch
Copy link
Copy Markdown
Member Author

@Lukasa You mind merging over the expected breaking change CI failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants