RequestCompletionHandler
public protocol RequestCompletionHandler
Provides callbacks for a RequestDelegate
to use once its underlying operation is complete and it has response data
to report.
See also
RequestDelegate.startUnderlyingOperation(completionHandler:)
-
Indicates that the
RequestDelegate
’s underlying operation has produced a response, and the request is thus complete.RequestDelegate
s MUST eventually call this method at least once after the call toRequestDelegate.startUnderlyingOperation(...)
, and SHOULD call it exactly once.Note
The
Request
will pass this data on to the request hooks exactly as is. The pipeline only applies to standard network requests.Note
Siesta only uses the response data from the first call to this method. You may call this method multiple times, but Siesta will ignore all subsequent calls.
Declaration
Swift
func broadcastResponse(_ newInfo: ResponseInfo)
-
Indicates whether Siesta would ignore the given response info if it were passed to
broadcastResponse(_:)
.RequestDelegate
s SHOULD use this to avoid doing unnecessary post-processing or follow-up operations after the underlying operation has produced a response.Declaration
Swift
func willIgnore(_ responseInfo: ResponseInfo) -> Bool