Skip to content

When should I wrap the InboundProtocol in ReadyUpgrade? #3963

Closed Answered by thomaseizinger
pieterdd asked this question in Q&A
Discussion options

You must be logged in to vote

There is ongoing work to deprecate and eventually remove the former, see #2863.

Hopefully, a ConnectionHandler will in the future just return a list of StreamProtocols that it wants to listen on.

In regards to the implications:

The former gives you a bit more type-safety because the connection task will run the upgrade future for you and only give you back the result. The downside is that it is quite verbose and hard to understand because there are many moving pieces:

  • InboundUpgrade
  • OutboundUpgrade
  • DialUpgradeError
  • ListenUpgradeError
  • UpgradeInfo

Another downside is that there is less flexibility in what you can do with the stream. You have to process it fully within the upgrade traits.

T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pieterdd
Comment options

Answer selected by pieterdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants