Skip to content

Initializer

init(managedAsyncStream:count:byteBufferAllocator:)

Creates a managed chunked HTTP Response steam using AsyncBodyStreamWriter that automtically closes or fails based if the closure throws an error or returns.
init(managedAsyncStream: @escaping @Sendable (any AsyncBodyStreamWriter) async throws -> (), count: Int, byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator())

Parameters

count

The amount of bytes that will be written. The asyncStream MUST produce exactly count bytes.

byteBufferAllocator

The allocator that is preferred when writing data to SwiftNIO