Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Conversation

@jhford
Copy link
Contributor

@jhford jhford commented Feb 15, 2016

@jonasfj what do you think about this?

@jonasfj
Copy link
Contributor

jonasfj commented Feb 17, 2016

This looks solid... One minor feature request is the ability to pass the session object via the constructor.

I see there is no way default session...

Also I see no need for resetSession... People can do my_client.session = ...
If they really want to... But if they do this, it must be because they really know what they are doing.

I might be missing something but I see no use case for resetSession... You always want connection polling... Probably even a global one, I know I'm tempted to suggest making a single globale default session. That's what we do in node...

@jhford
Copy link
Contributor Author

jhford commented Feb 17, 2016

I sort of want to make it so that someone can have a new session without having to import requests directly, but i don't feel strongly about including this method or not.

I'll add the ability to pass in a session. Do we really want a global session? I feel like when I make a new API client that the object I have should be distinct from all others.

@jhford jhford merged commit f537e43 into master Feb 17, 2016
@jonasfj jonasfj deleted the use-sessions branch February 17, 2016 23:31
@jonasfj
Copy link
Contributor

jonasfj commented Feb 17, 2016

I sort of want to make it so that someone can have a new session without having to import requests directly, but i don't feel strongly about including this method or not.

Agree... you can accept None and then fallback to creating a new session...
Or we could have a global session variable declared at module level.

log.debug(dict((k, v) for k, v in o.items() if k != 'credentials'))

if session:
self.session = options.session
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be: self.session = session?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. that was a typo from addressing review feedback. this would still work if you pass in the session as part of options, but thats not the desired situation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants