Multiple connection in NodeJS

Shakthi
Hi Everyone,

I am a newbie to Kite. Kindly let me know the followings:

1) how to establish multiple connection in nodejs(https://github.com/rainmattertech/kiteconnectjs)
2) how to dynamically subscribe instrument tokens in nodejs.
Tagged:
  • sujith
    Hi @Shakthi,
    Please take a look at this.
  • Shakthi
    Hi Sujith,

    I read through the doc and I have subscribed for multiple instruments in single instance.

    eg:
    var items = [738561,14565634];
    ticker.subscribe(items);
    ticker.setMode(ticker.full, items);

    I would like to know if I can subscribe one more item after receiving input from the user by the below statement.

    eg: ticker.subscribe([11547906]);

    As there is a hard stop at 200 tokens per connection. Let me know how to create a new connection?
  • sujith
    @Shakthi,
    Yes, you can subscribe to tokens anytime.

    you create one more KiteTicker object and follow same procedure to create one more connection.
  • Shakthi
    @Sujith,

    Thanks much.

    Do I need to unsubscribe all tokens before subscribing for a new instrument token along with existing tokens. I am unsure on this procedure?

    Can I use same api_key,user_id and public_token for multiple KiteTicker object?

  • sujith
    @Shakthi,
    You don't have to subscribe to all tokens for subscribing to new token.

    Yes, you can use same params. For more info checkout examples here.
Sign In or Register to comment.