-
Notifications
You must be signed in to change notification settings - Fork 1
EventMonitor
Protocol outlining the lifetime events inside Alamofire. It includes both events received from the various
URLSession
delegate protocols as well as various events from the lifetime of Request
and its subclasses.
public protocol EventMonitor
The DispatchQueue
onto which Alamofire's root CompositeEventMonitor
will dispatch events. .main
by default.
var queue: DispatchQueue
Event called during URLSessionDelegate
's urlSession(_:didBecomeInvalidWithError:)
method.
func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?)
Event called during URLSessionTaskDelegate
's urlSession(_:task:didReceive:completionHandler:)
method.
func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge)
Event called during URLSessionTaskDelegate
's urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)
method.
func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64)
Event called during URLSessionTaskDelegate
's urlSession(_:task:needNewBodyStream:)
method.
func urlSession(_ session: URLSession, taskNeedsNewBodyStream task: URLSessionTask)
Event called during URLSessionTaskDelegate
's urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)
method.
func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest)
Event called during URLSessionTaskDelegate
's urlSession(_:task:didFinishCollecting:)
method.
func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics)
Event called during URLSessionTaskDelegate
's urlSession(_:task:didCompleteWithError:)
method.
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)
Event called during URLSessionTaskDelegate
's urlSession(_:taskIsWaitingForConnectivity:)
method.
@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask)
Event called during URLSessionDataDelegate
's urlSession(_:dataTask:didReceive:)
method.
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data)
Event called during URLSessionDataDelegate
's urlSession(_:dataTask:willCacheResponse:completionHandler:)
method.
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse)
Event called during URLSessionDownloadDelegate
's urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)
method.
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64)
Event called during URLSessionDownloadDelegate
's urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)
method.
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64)
Event called during URLSessionDownloadDelegate
's urlSession(_:downloadTask:didFinishDownloadingTo:)
method.
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL)
Event called when a URLRequest
is first created for a Request
. If a RequestAdapter
is active, the
URLRequest
will be adapted before being issued.
func request(_ request: Request, didCreateInitialURLRequest urlRequest: URLRequest)
Event called when the attempt to create a URLRequest
from a Request
's original URLRequestConvertible
value fails.
func request(_ request: Request, didFailToCreateURLRequestWithError error: AFError)
Event called when a RequestAdapter
adapts the Request
's initial URLRequest
.
func request(_ request: Request, didAdaptInitialRequest initialRequest: URLRequest, to adaptedRequest: URLRequest)
Event called when a RequestAdapter
fails to adapt the Request
's initial URLRequest
.
func request(_ request: Request, didFailToAdaptURLRequest initialRequest: URLRequest, withError error: AFError)
Event called when a final URLRequest
is created for a Request
.
func request(_ request: Request, didCreateURLRequest urlRequest: URLRequest)
Event called when a URLSessionTask
subclass instance is created for a Request
.
func request(_ request: Request, didCreateTask task: URLSessionTask)
Event called when a Request
receives a URLSessionTaskMetrics
value.
func request(_ request: Request, didGatherMetrics metrics: URLSessionTaskMetrics)
Event called when a Request
fails due to an error created by Alamofire. e.g. When certificate pinning fails.
func request(_ request: Request, didFailTask task: URLSessionTask, earlyWithError error: AFError)
Event called when a Request
's task completes, possibly with an error. A Request
may receive this event
multiple times if it is retried.
func request(_ request: Request, didCompleteTask task: URLSessionTask, with error: AFError?)
Event called when a Request
is about to be retried.
func requestIsRetrying(_ request: Request)
Event called when a Request
finishes and response serializers are being called.
func requestDidFinish(_ request: Request)
Event called when a Request
receives a resume
call.
func requestDidResume(_ request: Request)
Event called when a Request
's associated URLSessionTask
is resumed.
func request(_ request: Request, didResumeTask task: URLSessionTask)
Event called when a Request
receives a suspend
call.
func requestDidSuspend(_ request: Request)
Event called when a Request
's associated URLSessionTask
is suspended.
func request(_ request: Request, didSuspendTask task: URLSessionTask)
Event called when a Request
receives a cancel
call.
func requestDidCancel(_ request: Request)
Event called when a Request
's associated URLSessionTask
is cancelled.
func request(_ request: Request, didCancelTask task: URLSessionTask)
Event called when a DataRequest
calls a Validation
.
func request(_ request: DataRequest, didValidateRequest urlRequest: URLRequest?, response: HTTPURLResponse, data: Data?, withResult result: Request.ValidationResult)
Event called when a DataRequest
creates a DataResponse<Data?>
value without calling a ResponseSerializer
.
func request(_ request: DataRequest, didParseResponse response: DataResponse<Data?, AFError>)
Event called when a DataRequest
calls a ResponseSerializer
and creates a generic DataResponse<Value, AFError>
.
func request<Value>(_ request: DataRequest, didParseResponse response: DataResponse<Value, AFError>)
Event called when an UploadRequest
creates its Uploadable
value, indicating the type of upload it represents.
func request(_ request: UploadRequest, didCreateUploadable uploadable: UploadRequest.Uploadable)
Event called when an UploadRequest
failed to create its Uploadable
value due to an error.
func request(_ request: UploadRequest, didFailToCreateUploadableWithError error: AFError)
Event called when an UploadRequest
provides the InputStream
from its Uploadable
value. This only occurs if
the InputStream
does not wrap a Data
value or file URL
.
func request(_ request: UploadRequest, didProvideInputStream stream: InputStream)
Event called when a DownloadRequest
's URLSessionDownloadTask
finishes and the temporary file has been moved.
func request(_ request: DownloadRequest, didFinishDownloadingUsing task: URLSessionTask, with result: Result<URL, AFError>)
Event called when a DownloadRequest
's Destination
closure is called and creates the destination URL the
downloaded file will be moved to.
func request(_ request: DownloadRequest, didCreateDestinationURL url: URL)
Event called when a DownloadRequest
calls a Validation
.
func request(_ request: DownloadRequest, didValidateRequest urlRequest: URLRequest?, response: HTTPURLResponse, fileURL: URL?, withResult result: Request.ValidationResult)
Event called when a DownloadRequest
creates a DownloadResponse<URL?, AFError>
without calling a ResponseSerializer
.
func request(_ request: DownloadRequest, didParseResponse response: DownloadResponse<URL?, AFError>)
Event called when a DownloadRequest
calls a DownloadResponseSerializer
and creates a generic DownloadResponse<Value, AFError>
func request<Value>(_ request: DownloadRequest, didParseResponse response: DownloadResponse<Value, AFError>)
Generated at 2020-09-24T22:11:06+0000 using swift-doc 1.0.0-beta.4.
Types
- AF
- AFError
- AFError.MultipartEncodingFailureReason
- AFError.ParameterEncoderFailureReason
- AFError.ParameterEncoderFailureReason.RequiredComponent
- AFError.ParameterEncodingFailureReason
- AFError.ResponseSerializationFailureReason
- AFError.ResponseValidationFailureReason
- AFError.ServerTrustFailureReason
- AFError.ServerTrustFailureReason.Output
- AFError.URLRequestValidationFailureReason
- Adapter
- AlamofireExtension
- AlamofireNotifications
- ClosureEventMonitor
- CompositeEventMonitor
- CompositeTrustEvaluator
- ConnectionLostRetryPolicy
- DataRequest
- DataResponse
- DataResponseSerializer
- DecodableResponseSerializer
- DefaultTrustEvaluator
- DisabledEvaluator
- DownloadRequest
- DownloadRequest.Downloadable
- DownloadRequest.Options
- DownloadResponse
- Empty
- GoogleXSSIPreprocessor
- HTTPHeader
- HTTPHeaders
- HTTPMethod
- Interceptor
- JSONEncoding
- JSONParameterEncoder
- JSONResponseSerializer
- MultipartFormData
- NetworkReachabilityManager
- NetworkReachabilityManager.NetworkReachabilityStatus
- NetworkReachabilityManager.NetworkReachabilityStatus.ConnectionType
- PassthroughPreprocessor
- PinnedCertificatesTrustEvaluator
- PublicKeysTrustEvaluator
- Redirector
- Redirector.Behavior
- Request
- Request.State
- ResponseCacher
- ResponseCacher.Behavior
- Retrier
- RetryPolicy
- RetryResult
- RevocationTrustEvaluator
- RevocationTrustEvaluator.Options
- ServerTrustManager
- Session
- SessionDelegate
- StringResponseSerializer
- URLEncodedFormEncoder
- URLEncodedFormEncoder.ArrayEncoding
- URLEncodedFormEncoder.BoolEncoding
- URLEncodedFormEncoder.DataEncoding
- URLEncodedFormEncoder.DateEncoding
- URLEncodedFormEncoder.Error
- URLEncodedFormEncoder.KeyEncoding
- URLEncodedFormEncoder.SpaceEncoding
- URLEncodedFormParameterEncoder
- URLEncodedFormParameterEncoder.Destination
- URLEncoding
- URLEncoding.ArrayEncoding
- URLEncoding.BoolEncoding
- URLEncoding.Destination
- UploadRequest
- UploadRequest.Uploadable
Protocols
- AlamofireExtended
- CachedResponseHandler
- DataDecoder
- DataPreprocessor
- DataResponseSerializerProtocol
- DownloadResponseSerializerProtocol
- EmptyResponse
- EventMonitor
- ParameterEncoder
- ParameterEncoding
- RedirectHandler
- RequestAdapter
- RequestDelegate
- RequestInterceptor
- RequestRetrier
- ResponseSerializer
- ServerTrustEvaluating
- URLConvertible
- URLRequestConvertible
- UploadConvertible
- UploadableConvertible