-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async methods for NIORawSocketBootstrap
#2460
Conversation
/// - Returns: A `NIOAsyncChannel` for the bound connection. | ||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) | ||
@_spi(AsyncChannel) | ||
public func bind<Inbound: Sendable, Outbound: Sendable>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be providing the initialiser for this (and connect
) here?
We have a split world where you can specify it in the initialiser on the bootstrap and in some cases (protocol negotiation and the "return whatever you want from the initializer") in bind
/connect
.
It might be easier if all the async
bind
/connect
methods have initialisers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah realised this today as well but we gotta revisit it holistically. I will defer this to the overall API review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we not add them with inits in the other NIO bootstraps though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, the NIOAsyncChannel
based ones are all without an explicit initialiser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo one nit
/// - Returns: A `NIOAsyncChannel` for the bound connection. | ||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) | ||
@_spi(AsyncChannel) | ||
public func bind<Inbound: Sendable, Outbound: Sendable>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we not add them with inits in the other NIO bootstraps though?
b8786cc
to
2a94c6e
Compare
b63704c
to
2bebb36
Compare
# Motivation We want to support async bootstrapping with all our bootstraps. # Modification This PR adds support for the `NIORawSocketBootstrap` and adds the three variants of methods to it (abstract output, `NIOAsyncChannel` based and protocol negotiation based) # Result We now support asynchronous interaction with the `NIORawSocketBootstrap`
2bebb36
to
f8dbe9e
Compare
Motivation
We want to support async bootstrapping with all our bootstraps.
Modification
This PR adds support for the
NIORawSocketBootstrap
and adds the three variants of methods to it (abstract output,NIOAsyncChannel
based and protocol negotiation based)Result
We now support asynchronous interaction with the
NIORawSocketBootstrap