Skip to content

Conversation

@ulope
Copy link
Contributor

@ulope ulope commented Mar 29, 2018

This PR introduces a per MatrixHttpApi instance requests Session which is then used to perform the API HTTP calls instead of the previous ad-hoc requests.request() calls.

This enables a few desirable properties:

  • Connection pooling / HTTP keep-alive
  • Automatic transparent cookie support (useful for some load balancer setups)
  • Easy request customization through TransportAdapters (e.g for custom auth schemes etc.)

@non-Jedi
Copy link
Collaborator

Hm. This is moving in the opposite direction of #126, but I can definitely see the benefits. @Matrixcoffee do you have any thoughts on this?

@ghost
Copy link

ghost commented Mar 29, 2018

I also see the benefits, and I think I can work with this from a urllib-requests-adapter point-of-view. We'll see how to deal with this when the time comes to drop Python 2 support.

@non-Jedi non-Jedi self-assigned this Mar 29, 2018
@non-Jedi
Copy link
Collaborator

In that case, this LGTM. @ulope could you please signoff per the CONTRIBUTING.rst?

@ulope
Copy link
Contributor Author

ulope commented Mar 29, 2018

I hadn’t seen #126 but am glad that that you chose to accept this anyway :)

Sign off as requested:

Signed-off-by: Ulrich Petri
github@ulo.pe

@non-Jedi
Copy link
Collaborator

Thanks! See 3365612

@non-Jedi non-Jedi closed this Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants