kmadac / bitstamp-python-client

Python package to communicate with bitstamp.net
MIT License
143 stars 70 forks source link

Use requests sesison to preserve TCP connection #27

Open martinramsdale opened 6 years ago

martinramsdale commented 6 years ago

Use requests session to preserve TCP connection - massively improves performance

[ NB: tests not run ]

kmadac commented 6 years ago

Hi @martinramsdale. Thank you for pull request. I'm sorry I cannot merge it as unit tests are not passing. Can you try to make tests run?

kmadac commented 6 years ago

Hi @martinramsdale, I just modified the tests to work with your changes. Can you please allow me to push changes to your PR branch created from a fork? Here is how to do it: https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/

SmileyChris commented 6 years ago

If you're going to add this, perhaps you should make the requests session passable into BaseClient for more flexibility.

martinramsdale commented 6 years ago

@kmadac Thanks for fixing up the tests. I was doing some manual testing since posting the PR and have noticed some intermittent errors being returned from BitStamp with these diffs. I haven't had a chance to repro/debug further, but for now am going to hold off on collapsing until I can confirm either way. @SmileyChris: Pending debug above, yes this seems like a reasonable idea, will add