Skip to content
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

Move request handling to IO thread #457

Closed
14 of 15 tasks
whiskeysierra opened this issue Jul 18, 2018 · 0 comments
Closed
14 of 15 tasks

Move request handling to IO thread #457

whiskeysierra opened this issue Jul 18, 2018 · 0 comments
Labels

Comments

@whiskeysierra
Copy link
Collaborator

whiskeysierra commented Jul 18, 2018

Detailed Description

Instead of using the current thread we should use the IO thread already during request creating, i.e. earlier.

Context

Right now the only thing that happens on the IO thread is the waiting for the response and the response processing. Everything related to the request, including but not limited to DNS lookup, body serialization, opening a connection and writing the request, is done on the calling thread. All of that has to move to the IO thread already. Unfortunately this is not straightfoward with the current API of AsyncClientHttpRequestFactory and AsyncClientHttpRequest.

Related to #449.

Possible Implementation

  1. Move from AsyncClientHttpRequestFactory to ClientHttpRequestFactory
    • Modify RestAsyncClientHttpRequestFactory
      • to not implement AsyncClientHttpRequestFactory
      • remove AsyncListenableTaskExecutor dependency
    • Maybe take the opportunity to rename everything in riptide-httpclient to Apache*?
    • Modify Http's builder API
      • Add new stage ExecutorStage to Http interface which requires an Executor
      • Make new stage mandatory first or second step when constructing Http instance
      • Remove RequestFactoryStage.simpleRequestFactory(..)
    • Pass executor to DefaultHttp
    • Pass executor to Requester
    • Call the following methods within a runnable passed to the executor
      • ClientHttpRequestFactory.createRequest(..)
      • MessageWorker.write(..)
      • ClientHttpRequest.execute()
    • Enabled warning on deprecation now? See Fail on deprecation #329

Your Environment

  • Version used: 2.9.0-RC.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant