StackExchange / StackExchange/StackExchange.Redis

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

Open
#2,597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue body is the only provided entry point and names no files or tests. Start by reviewing the documented synchronous and asynchronous subscription APIs and their disposal behavior. Done would be a clear maintainer answer or documentation update explaining whether mixing SubscribeAsync with Unsubscribe is supported and when UnsubscribeAsync is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
databases
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.