Home › Forums › kdb+ › How to re-subscription automatically in kdb-tick? › Re: How to re-subscription automatically in kdb-tick?
-
It can be done using the built-in handlers .z.pc (connection close) and .z.ts (timer). When the connection closes, you could set up a periodic timer that tries to reopen the connection.
Because doing this at the low level is cumbersome and is kind of reinventing the wheel, there are open source implementations that allow setting timers and auto-reconnecting connections, such as this one:
kdb/q/conn at main finos/kdb (github.com)
This allows you to set up a connection that is automatically reopened using a timer. You could put the subscription code in the connect callback.