StreamingNSURLSessionHttpEngine

class StreamingNSURLSessionHttpEngine(timeoutMillis: Long) : HttpEngine

An HttpEngine based on NSURLSession with the ability to stream data as it is received when using Transfer-Encoding: Chunked. This is useful when using @defer.

Note: this implementation only works when using the new native memory manager as multiple threads mutate the internal state.

That is why it is considered experimental and subject to change.

Using the default DefaultHttpEngine will work when using @defer, but the payloads are buffered until the response is fully received, thus losing the incremental nature of the response.

Constructors

Link copied to clipboard
fun StreamingNSURLSessionHttpEngine(timeoutMillis: Long)

Functions

Link copied to clipboard
open override fun dispose()

Disposes any resources used by the HttpEngine

Link copied to clipboard
open suspend override fun execute(request: HttpRequest): HttpResponse

Executes the given HttpRequest