question

Upvotes
Accepted
9 1 3 5

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.

Hello @ichernyavskiy,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Upvotes
Accepted
32.2k 40 11 20

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 5

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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