StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.88k stars 1.51k forks source link

Should I call .SubscribeAsync and then .Unsubscribe (not Async)? #2597

Open katatunix opened 10 months ago

katatunix commented 10 months ago

This is not an issue but my question about best practices when using this awesome library.

I subscribed to a channel with

var cmq = conn.GetSubscriber().SubscribeAsync(channel)

Then, when my disposable object is disposed, I call cmq.Unsubscribe() not cmq.UnsubscribeAsync().

Is there any problem with that?