tardis-dev/tardis-node

[question] streamNormalized with zero timeoutIntervalMS

kovetskiy opened this issue · 1 comments

Hello there, we are extensively using tardis-node in our project, some of exchanges have low number of trades per a period of time on specific assets.

We use https://docs.tardis.dev/api/node-js#stream-normalized-options to get this data, and we see that it is getting disconnected every 10 seconds because of timeoutIntervalMS. I've double checked the exchange, and I can see that the assets we are following get traded like once per hour.

We are considering setting timeoutIntervalMS to zero to avoid this function get called:

private _monitorConnectionIfStale() {
which terminates the connection if no packets were received during this timeoutIntervalMS time:
this._ws!.terminate()

Do you think this is a good idea? Would it lead to other problems?

should be fine, but could also lead to stale connection (open but inactive WS connection), it's not very common but this is what this mechanism was for.