-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add RedisChannel UseImplicitAutoPattern and IsPatternBased #2480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| get => s_DefaultPatternMode == PatternMode.Auto; | ||
| set => s_DefaultPatternMode = value ? PatternMode.Auto : PatternMode.Literal; | ||
| } | ||
| private static PatternMode s_DefaultPatternMode = PatternMode.Auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a property to ConfigurationOptions to control this default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't; ConfigurationOptions is per-instance, this is global; existing code like (RedisChannel)"abc" is not aware of any config model, so would have nowhere to get the info from, and if we try to make ConfigurationOptions touch the global setting, then it will be "last model wins", which is ultra unfriendly; at least the global nature is clear
mark the implicit RedisChannel operators as [Obsolete]
|
You marked string initialization of RedisChannel as Obsolete, but there is no any doumentation how to use new RedisChannel functions. |
|
The obsolete message literally gives that guidance, but yes we should check for any existing docs and update |
A guidance? It raises questions only. What is PatternMode and Literal/Pattern methods? |
|
I will revise the message, and improve the docs, but to give you an answer today: |
|
ok, understood now, so instead of providing string key for subscribe, we need to use RedisChannel.Literal(key) or RedisChannel.Pattern(keysPattern) if using patterns |
|
You can still use a string if you eat the CS0618 - and if you want to use the old behaviour without the warning, the constructor (explicitly stating |
|
Just getting around to a package update. This obsolete message still completely lacks context, and all I've been able to find is this PR, which is also absent intent of the change. |
|
I'll try to improve that. Short version:
|
|
@mgravell that makes sense, thank you. I think the missing context was that, until this, I wasn't aware that wildcards were possible in the pub/sub, so that's something new to me. I can't think of any situations where I would want to do that, but I suppose someone else could. |
|
Right; so use RedisChannel.Literal - job done |
|
One part of the missing doc update is the redis backplane docs which use the obsolete string method. |
|
I can take that, thanks |
fixes #2479 (option 1)