pusher / push-notifications-python

Pusher Beams Python Server SDK
https://pusher.com/beams
MIT License
30 stars 8 forks source link

Share session between requests #31

Open allburov opened 7 months ago

allburov commented 7 months ago

Hi! It's fine (and better) to share the session instance between requests.

https://requests.readthedocs.io/en/latest/user/advanced/

So if you’re making several requests to the same host, the underlying TCP connection will be reused, which can result in a significant performance increase (see HTTP persistent connection).

Another benefit - we get access to beams.session and we can configure it as we want to (our case it to add logging for the pusher beams client http requests\responses)