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

aiohttp.HttpClient #58

Closed
asvetlov opened this issue May 28, 2014 · 6 comments
Closed

aiohttp.HttpClient #58

asvetlov opened this issue May 28, 2014 · 6 comments

Comments

@asvetlov
Copy link
Member

What the purpose of the class?
From my perspective it solves very specific problem and should be moved to some separate project if you really need for it.
For example now I'm solving similar problem but my criteria for 'good' answer much more complex -- even if host send a response the host may be marked as 'failed' by analyzing response status code, body and headers.
I think there are no common solution for the problem -- or the solution will be too complicated for simple and low level library like aiohttp.

@fafhrd91
Copy link
Member

i have two use case at the moment for this class:

  1. you can configure schema, host, port once and then use only paths to access your service. for example
client = aiohttp.HttpClient(hosts=['...'])
yield from client.request('/path1')
yield from client.request('/path2')
  1. if you have multiple servers or load balancers and you want to access all of them (example is riak)

i'd rather see hooks for custom failure detection than removing this class.

@asvetlov
Copy link
Member Author

In private chat with @fafhrd91 we decided to leave HttpClient for now.
Closing the issue.

@ludovic-gasc
Copy link
Contributor

Hi @asvetlov, I'm not agree with you.
For me, aiohttp handles HTTP (Client, Server, Websockets, Gunicorn) for AsyncIO Python world. From my point of view, not a good idea to split this project to several projects because:

  1. The source code size is small, easy to find information inside, it isn't a spaghetti source code that need to split.
  2. Few people is contributing on this project, easier to contribute if everything is in the same place.

Nevertheless, Client API could be improved to be easier to use, and also error handling.

@asvetlov
Copy link
Member Author

I don't want to split aiohhtp to several projects.
From my perspective the HttpClient is not good citizen for Public API, that's all.
I'm ok for keeping it for a while.

Have you some ideas for improvement Client API and error handling?
Please make an issue if you have some proposal.

@ludovic-gasc
Copy link
Contributor

I don't made enough code with Client API to have a pertinent opinion for now.
My main issue was about headers handling, I had write more code that with Requests because it wasn't a dict but a deque, but this problem is solving (#62), thanks to you ;-)

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants