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

Calling result() on a list of futures #68

Closed
ogrubes opened this issue Dec 3, 2014 · 2 comments · Fixed by #69
Closed

Calling result() on a list of futures #68

ogrubes opened this issue Dec 3, 2014 · 2 comments · Fixed by #69
Labels

Comments

@ogrubes
Copy link

ogrubes commented Dec 3, 2014

If you declare a list of futures, and then later call result() on each future, swaggerpy will return a list of identical values corresponding to the last future created.

ex:
myfutures = [swaggerclient.myendpoint for elem in elem_list]
myresults = [future.result() for future in myfutures]

myresults will return a list of identical values, all equal to myfutures[-1].result()

@dnephin
Copy link
Contributor

dnephin commented Dec 3, 2014

I believe this is caused by: https://github.com/Yelp/swagger-py/blob/master/swaggerpy/response.py#L42

setup() should not be part of the HttpClient api, the clients are shared, and they shouldn't be treated as immutable.

The request params should get stored on the HTTPFuture instead I think.

@dnephin dnephin added the bug label Dec 3, 2014
@dnephin
Copy link
Contributor

dnephin commented Dec 3, 2014

There are actually a bunch of methods that mutate state on the HTTPClient object, I think a bunch of those are going to need to change, and be moved onto a Request object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants