didReceiveBodyPart(task:_:)
FileDownloadDelegate.swift:147func didReceiveBodyPart(task: HTTPClient.Task<Response>, _ buffer: ByteBuffer) -> EventLoopFuture<Void>
func didReceiveBodyPart(task: HTTPClient.Task<Response>, _ buffer: ByteBuffer) -> EventLoopFuture<Void>
s15AsyncHTTPClient20FileDownloadDelegateC18didReceiveBodyPart4task_7NIOCore15EventLoopFutureCyytGAA0B0C4TaskCy_AC8ProgressVG_AF10ByteBufferVtF
What are these?9MK2T
import AsyncHTTPClient
This package provides simple HTTP Client library built on top of SwiftNIO.
final class FileDownloadDelegate
Handles a streaming download to a given file path, allowing headers and progress to be reported.
class HTTPClient
HTTPClient class provides API for request execution.
final class Task<Response>
Response execution context.
typealias Response = Progress
struct ByteBuffer
ByteBuffer
stores contiguously allocated raw bytes. It is a random and sequential accessible sequence of zero or more bytes (octets).
final class EventLoopFuture<Value>
Holder for a result that will be provided later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
init(path: String, pool: NIOThreadPool? = nil, reportHead: ((HTTPClient.Task<Response>, HTTPResponseHead) -> Void)? = nil, reportProgress: ((HTTPClient.Task<Response>, Progress) -> Void)? = nil) throws
Initializes a new file download delegate.
convenience init(path: String, pool: NIOThreadPool, reportHead: ((HTTPResponseHead) -> Void)? = nil, reportProgress: ((Progress) -> Void)? = nil) throws
Initializes a new file download delegate.
convenience init(path: String, reportHead: ((HTTPResponseHead) -> Void)? = nil, reportProgress: ((Progress) -> Void)? = nil) throws
Initializes a new file download delegate and uses the shared thread pool of the HTTPClient
for file I/O.
func didFinishRequest(task: HTTPClient.Task<Response>) throws -> Response
func didReceiveError(task: HTTPClient.Task<Progress>, _ error: Error)
func didReceiveHead(task: HTTPClient.Task<Response>, _ head: HTTPResponseHead) -> EventLoopFuture<Void>
struct Progress
The response type for this delegate: the total count of bytes as reported by the response “Content-Length” header (if available) and the count of bytes downloaded.