Closed
Description
In some cases it's desirable to be able to control which EventLoop
a request is executed on. For instance, if uploading a file using NIO's NonBlockingFileIO
we currently incur the cost of hopping between the event loop reading from disk and the event loop writing to the network on every chunk.
HTTPClient.execute
could be updated as follows:
public func execute<T: HTTPClientResponseDelegate>(request: Request, delegate: T, eventLoop: EventLoop? = nil, deadline: NIODeadline? = nil) -> Task<T.Response> {
let eventLoop = eventLoop ?? self.eventLoopGroup.next()
...
}