Do you have an example of how to unsubscribe for a given symbol? Let's say I am subscribing to SPY and DIA. I want to unsubscribe from SPY. How would I do this without unsubscribing from DIA?
Hello @ichernyavskiy,
Your app should be able to unsubscribe, via DeleteWatch, from any instrument you have subscribed via AddWatch.
I have added Unsubscribe, via DeleteWatch, to our C# REDI Monitoring L1 Console example and tutorial code on github
I think this addition should be useful, for developers monitoring L1 quotes from C#.
Please let us know if this helps to clarify?
Please see CacheControl -> DeleteWatch in RediSpec
Does this work for you? Do you need a complete code example?
Zoya, I've tried several different ways of unsubscribing from one symbol and none work. In my sample code I added a method unsubscribe in same class as subscribe, getCell and CacheEvent handler. Pass it a symbol. In my case SPY
Public Sub Unsubscribe(ByVal Symbol As String)
quoteCacheTest.DeleteWatch(0, Symbol, "", err)
End Sub
Once I triger it, I can still see SPY getting updates in CacheEvent.
I've attached image showing how subscribing and unsubscribing is getting called. Perhaps you can take a look at tell me if I am doing something silly.
subscribe-now.png
The example helped tremendously.
I was created way too many objects. What I should have done is query my dictionary for quoteCache that I have for a given symbol and use that to unsubscribe. Thank you so much!
zoya.farberov,
The C# REDI Monitoring L1 Console example creates a new CacheControl for every quote subscription. I'm pretty sure this is a bad example of how to use CacheControl. Can you possibly fix this example so more people aren't confused?