REDILIB resubscribe using same QuoteCache

I am trying to figure out if I can re-use same QuoteCache object

in my subscribe, I do something like below.

quoteCacheControl = New RediLib.CacheControl
qCache = New QuoteCache(quoteCacheControl, symbol)
qCache.Subscribe()
QuoteDict.Add(symbol, qCache)

In my unsubscribe, I find quoteCache in my collection and unsubscribe
Dim qc1 As QuoteCache = Nothing

If QuoteDict.TryGetValue(symbol, qc1) Then

qc1.Subscribe()

End If

If I looped through my collection of QuoteCache objects and unsubscribed from all symbols but did not remove quoteCache object that was unsubscribed

Can I later loop through that same collection and subscribe again or is the QuoteCache object destroyed on unsubscribe?

Tagged:

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @ichernyavskiy,

    Yes, you can unsubscribe, and submit, and stop receiving updates.

    Then, later, subscribe and submit on the same CacheControl and should receive the updates again.

Answers

  • Thank you, Zoya. Got a little busy with coding and forgot to mark your answer as accepted.