Closed CDargis closed 5 years ago
It is the IConnectionMultiplexer
which should be long-lived. The RedisContext
object holds a reference to the connection multiplexer. So I think you are doing fine, as long as the multiplexer you are injecting is long-lived.
Another option would be to maintain just a static RedisContext
object and when you need the IConnectionMultiplexer
you can get it with var mux = redisContext.GetConnectionMultiplexer()
Thanks!
Hi there. Not an issue just a question. The documentation here reads
Is it the RedisContext object that must be long-lived or the IConnectionMultiplexer ? Meaning if my multiplexer is long-lived and I am
new
ing upRedisContext
objects and injecting in the multiplexer, there is no concern there? Asking because I'll be usingCachingFramework.Redis
alongside another (separate) framework that requires aStackExchange.Redis.IConnectionMultiplexer
. I'd like both frameworks to use the same pool of multiplexers.Thanks.