question

Upvotes
Accepted
9 1 3 4

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?

redi-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
31.7k 37 11 19

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
9 1 3 4

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.