Instance Methodswift-nio 2.72.0NIOCore
write(contentsOf:)
Send an asynchronous sequence of writes into the ChannelPipeline
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func write<Writes>(contentsOf sequence: Writes) async throws where OutboundOut == Writes.Element, Writes : AsyncSequence
This will flush after every write.
This method suspends if the underlying channel is not writable and will resume once the it becomes writable again.
Other members in extension
Types
struct TestSink
An
AsyncSequence
backing aNIOAsyncChannelOutboundWriter
for testing purposes.
Type members
static func makeTestingWriter(
) -> (`Self`, TestSink) Creates a new
NIOAsyncChannelOutboundWriter
backed by aTestSink
. This is mostly useful for testing purposes where one wants to observe the written data.
Instance members
func finish(
) Finishes the writer.
func write(OutboundOut
) async throws Send a write into the
ChannelPipeline
and flush it right away.func write<Writes>(contentsOf: Writes
) async throws Send a sequence of writes into the
ChannelPipeline
and flush them right away.