Open markst opened 7 years ago
Related to issue #96. I'd like to be able to cancel the network request. If the NetworkClient protocol function were to return the URLSessionTask performed:
NetworkClient
URLSessionTask
func request(method: String, url: URL, payload: Data?, callback: @escaping NetworkClientCallback) -> URLSessionTask
It would be possible to cancel the request upon cancelling the operation:
override public func cancel() { super.cancel() self.networkTask?.cancel() }
Happy to create a PR if you think this is a good idea.
Related to issue #96. I'd like to be able to cancel the network request. If the
NetworkClient
protocol function were to return theURLSessionTask
performed:It would be possible to cancel the request upon cancelling the operation: