Skip to content

Accept EventLoop in HTTPClient.execute() #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ldewailly opened this issue Aug 12, 2019 · 0 comments
Closed

Accept EventLoop in HTTPClient.execute() #78

ldewailly opened this issue Aug 12, 2019 · 0 comments
Assignees
Labels
kind/enhancement Improvements to existing feature.
Milestone

Comments

@ldewailly
Copy link

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()
    ...
}
@artemredkin artemredkin self-assigned this Aug 12, 2019
@artemredkin artemredkin added the kind/enhancement Improvements to existing feature. label Aug 12, 2019
@artemredkin artemredkin added this to the 1.0.0 milestone Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants