Initializer
init(asyncStream:count:byteBufferAllocator:)
Creates a chunked HTTP
Response steam using AsyncBodyStreamWriter.init(asyncStream: @escaping @Sendable (any AsyncBodyStreamWriter) async throws -> (), count: Int, byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator())
Parameters
asyncStreamThe closure that will generate the results. MUST call
.endor.errorwhen terminating the streamcountThe amount of bytes that will be written. The
asyncStreamMUST produce exactlycountbytes.byteBufferAllocatorThe allocator that is preferred when writing data to SwiftNIO