[Swift 4] Add ability to pass in a dedicated queue for processing network response
Created by: joeboyscout04
Description
The Swift generator uses Alamofire under the hood, which provides this ability to pass in a dedicated background queue for processing responses. The default is the Main thread. This can cause performance problems when the body of the request is large.
openapi-generator version
3.0.0
Suggest a fix/enhancement
It would be simple to alter the Swift generator's AlamofireImplementations execute(completion: error:)
method to include an optional argument for queue
(default to nil
). The queue could then be passed to processRequest(completion:)
and then on to the various Alamofire response()
methods.
Then the user could implement their own AlamofireRequestBuilder
to override the queue.