StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Subscribe to all primaries (for key-space-notifications)

Open atakavci opened this issue 10 months ago • 1 comments

Closes/Fixes #2846

This essentially uses the same approach as subscription methods but runs on all primary nodes in the cluster, attempting to combine the results into a single output.

While some parts of it align with existing pub/sub functionality, making them reusable compromises readability. Therefore, I'm not sure it's preferable to make them reusable.

Another point is that I went back and forth on API naming, trying to decide whether to reference the keyspace or not. To provide more clarity on what is happening, I chose a name -SubscribeAllPrimariesAsync- that refers to the primaries, and I’ve kept the keyspace-related explanations in the documentation.

atakavci avatar Mar 14 '25 11:03 atakavci

@mgravell ,

  • non-'s' variants will get broadcast duplicates that will be hard to untangle
  • s variants don't make sense to attach to the entire cluster, since they are routed using shard rules

this makes total sense and my attempt is solely for the sake of key-space-notifications. alternatively i was also considering about a special kind of RedisChannel which is only targeting key-space-notifications by design.

atakavci avatar Mar 14 '25 14:03 atakavci