-
Notifications
You must be signed in to change notification settings - Fork 46
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
Clean up the code, add docstrings, and get rid of the poorly implemented async client #78
Conversation
Bonus point against async code - due to monkey patching upon import, grequests can cause warnings/bugs that might be very hard to find. See:
|
Looks good (but didn't test). |
@closeio/engineering I believe that once we add unit tests to this PR, we can release it as v1.0. Agreed? |
👍 |
Sounds good. So what's happening to async? Are there any plans for it? |
Given the arguments I laid out in #78 (comment) and in the description for #79, I think it might make sense to drop it altogether. This way we maintain a simple & readable helper library w/o any quirks while the users can choose to run multiple concurrent |
self.max_retries = max_retries | ||
self.tz_offset = tz_offset or str(local_tz_offset()) | ||
self.verify = verify | ||
|
||
if async: | ||
import grequests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably remove grequests etc now from setup.py and requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done in 02bad5b
@wojcikstefan Let's move forward with merging this? Can you handle conflicts and publish? |
Right now the async client makes the code more complex and doesn't really add much value. I doubt it's used in the wild and if it is, then the usage is probably quite confusing and hacky. I think we might as well get rid of it.
Examples of current confusing behavor:
api.get/post/put/delete
is still synchronousapi.map
expects a list ofgrequests.AsyncRequest
, but there's no easy way to construct them.This PR introduces breaking changes and should be published along with a major version bump.
TODO: