-
-
Notifications
You must be signed in to change notification settings - Fork 202
Compatibility with non default redis manager #957
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
Compatibility with non default redis manager #957
Conversation
…nted RedisFactory interface)
stayallive
left a comment
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.
Is you sentinel RedisManager implementation open-source or from a package?
|
|
||
| $this->container()->afterResolving(RedisManager::class, static function (RedisManager $redis): void { | ||
| $this->container()->afterResolving(RedisFactoryContract::class, static function (RedisFactoryContract $redis): void { | ||
| $redis->enableEvents(); |
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.
The Factory does not contains enableEvents so we can't make this change as is: https://github.com/laravel/framework/blob/7db7ea950d3df663391718730f4490a4e189234a/src/Illuminate/Contracts/Redis/Factory.php.
from package, it sounds like we can omit RedisManager type(and then add it to phpdoc)? |
|
Thanks for linking the package, looks like this will work for that specific package.
I don't understand what you mean with this? Can you elaborate? |
sure, here it is, with this realization it pass any RedisManager, default and any with implemented contract, so we can use custom manager or maybe I didn't understand you and you are worried about another problem? |
|
So the main concern is that Sentry is installed in many applications and if we ask to container to give us an object of the Since there is no real good workaround this we are not making this change at this time. You can add the following snippet to your own $this->app->afterResolving(\Monospice\LaravelRedisSentinel\RedisSentinelManager::class, static function (\Monospice\LaravelRedisSentinel\RedisSentinelManager $redis): void {
$redis->enableEvents();
}); |
change for compatibility with external redis manager (e.g. sentinel library in my case)