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

Reintroduce sync client #716

Closed
wants to merge 10 commits into from
Closed

Reintroduce sync client #716

wants to merge 10 commits into from

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Jan 3, 2020

Builds on #713 and reintroduces a sync Client.

>>> import httpx
>>> httpx.get('https://www.example.com')
<Response [200 OK]>

πŸŽ‰βœ¨ TA-DA! βœ¨πŸŽ‰

We're using urllib3 here as the backing service for our sync calls.

Potentially we could later switch away to using our own unasync'ed dispatcher. (Although it's actually feasible that we might just want to stick with urllib3 for the sync case.)

If we wanted to tackle this as a set of incremental PRs we would want:

  • Switch Dispatcher to AsyncDispatcher throughout.
  • Introduce a SyncDispatcher class.
  • Introduce a Proxy config class.
  • Split the client into the two sync and async cases, with a base class of BaseClient.
  • Update StreamContextManager to handle both sync and async cases.
  • Switch the top-level API back to sync.

Also still TODO here:

  • Tie in timeout and pool limits config properly.
  • Introduce a WSGIDispatcher class.
  • Introduce a URLLib3ProxyDispatcher class.
  • Plenty of docs updating.
  • Plenty of test updating.
  • Wrap urllib3 exceptions (Need to cover pool.urlopen and conn.stream methods)

@tomchristie
Copy link
Member Author

Now closing in favour of #735

@tomchristie tomchristie closed this Jan 7, 2020
@tomchristie tomchristie deleted the reintroduce-sync-client branch January 7, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant