Based on work by an Apple engineer (whose name I can’t remember) in the labs at WWDC, I've pushed a branch containing a few initial bits of support of Combine support for Alamofire. This includes:
URLRequests into Alamofire
DataRequests. This will eventually be enhanced with support for our
Publisherwhich adds a
responseDecodablehandler to a
DataRequestand passes along the
This allows for easy creation and response handling using Combine and Alamofire:
// When let urlRequest = URLRequest.makeHTTPBinRequest() _ = Publishers.Just(urlRequest) .request() .response(of: HTTPBinResponse.self)
Combine also makes it trivial to wait for the results of multiple requests, so thanks to @Tony_Parker and the Foundation team for such a commonly requested feature.
Ongoing issues include the lack the cancellation support, and there could be some queue hops internally, as the Alamofire response callback is called on a custom queue.
This can be tried out on the
initial-combine-support branch of Alamofire.