0xProject / standard-relayer-api

Standard specifications for 0x relayer public APIs
Apache License 2.0
164 stars 46 forks source link

document websocket connection heartbeat interval #20

Open BlinkyStitt opened 6 years ago

BlinkyStitt commented 6 years ago

I am using python's aiohttp library to handle websockets instead of your typescript library because I am just building a quick prototype and I know python better than javascript/typescript.

I have the subscribe command working and returning a bunch of orders, but 60 seconds after connecting, I get an error about an unclosed client session.

After some tinkering, I realized that I need to enable heartbeats to keep the connection alive. I changed my command to be async with http_session.ws_connect(relay_url, heartbeat=30) as ws:.

Heartbeats being necessary (and their recommended interval) should probably be added to the docs.

BMillman19 commented 6 years ago

@WyseNynja which API are you connected to?

BlinkyStitt commented 6 years ago

RadarRelay.

Side note: is there a list of all the public open relays somewhere?