Skip to content

Initializer

init(asyncStream:byteBufferAllocator:)

Creates a chunked HTTP Response steam using AsyncBodyStreamWriter.
init(asyncStream: @escaping @Sendable (any AsyncBodyStreamWriter) async throws -> (), byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator())

Parameters

asyncStream

The closure that will generate the results. MUST call .end or .error when terminating the stream

byteBufferAllocator

The allocator that is preferred when writing data to SwiftNIO