Initializerswift-nio 2.72.0NIOCore
init(wrappingChannelSynchronously:configuration:)
Initializes a new NIOAsyncChannel
wrapping a Channel
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
init(wrappingChannelSynchronously channel: Channel, configuration: Configuration = .init()) throws
Parameters
- channel
The
Channel
to wrap.- configuration
The
NIOAsyncChannel
s configuration.
Other members in extension
Types
Type members
init(wrappingChannelSynchronously: Channel, configuration: Configuration
) throws Initializes a new
NIOAsyncChannel
wrapping aChannel
where the outbound type isNever
.
Show implementation details (1)
Hide implementation details
static func _wrapAsyncChannelWithTransformations(wrappingChannelSynchronously: Channel, backPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, isOutboundHalfClosureEnabled: Bool, channelReadTransformation: @escaping (Channel) -> EventLoopFuture<Inbound>
) throws -> NIOAsyncChannel<Inbound, Outbound> This method is only used from our server bootstrap to allow us to run the child channel initializer at the right moment.
Show obsolete interfaces (3)
Hide obsolete interfaces
init(synchronouslyWrapping: Channel, configuration: Configuration
) throws Initializes a new
NIOAsyncChannel
wrapping aChannel
.init(synchronouslyWrapping: Channel, configuration: Configuration
) throws Initializes a new
NIOAsyncChannel
wrapping aChannel
where the outbound type isNever
.static func _wrapAsyncChannelWithTransformations(synchronouslyWrapping: Channel, backPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, isOutboundHalfClosureEnabled: Bool, channelReadTransformation: @escaping (Channel) -> EventLoopFuture<Inbound>
) throws -> NIOAsyncChannel<Inbound, Outbound> This method is only used from our server bootstrap to allow us to run the child channel initializer at the right moment.
Instance members
let channel: Channel
The underlying channel being wrapped by this
NIOAsyncChannel
.func executeThenClose<Result>((_ inbound: NIOAsyncChannelInboundStream<Inbound>, _ outbound: NIOAsyncChannelOutboundWriter<Outbound>) async throws -> Result
) async throws -> Result Provides scoped access to the inbound and outbound side of the underlying
Channel
.
Show obsolete interfaces (2)
Hide obsolete interfaces
var inbound: NIOAsyncChannelInboundStream<Inbound>
The stream of inbound messages.
var outbound: NIOAsyncChannelOutboundWriter<Outbound>
The writer for writing outbound messages.