BitMEX / api-connectors

Libraries for connecting to the BitMEX API.

Home Page:https://www.bitmex.com/app/restAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I add a Keep-Alive connection to a BitMEX-Python-client?

andant7 opened this issue · comments

The manual says:

"Our servers support HTTP Keep-Alive and cache SSL sessions. If you keep a connection alive, you will get websocket-like latency, obviating the need to use the websocket for transactional communication."

What needs to be changed in this client to add Keep-Alive there?
https://github.com/BitMEX/api-connectors/tree/master/official-http/python-swaggerpy

Or does this client already have Keep-Alive?

See https://bravado.readthedocs.io/en/stable/configuration.html#customizing-the-http-client for how you can add options. The docs for requests say:

Keep-alive and HTTP connection pooling are 100% automatic, thanks to urllib3.

So you should be fine. You can turn on debug logging to be sure.