Closed erizzo closed 3 years ago
Also interesting (to me at least) is that the events always have an Origin of Remote
even though my current testing only involves my single process connected to Redis running locally - all Puts, Adds, Updates, and Removes are running in a single process.
Sorry for the late answer,
Regarding why the second cache receives events, isn't that what you want if you use the backplane with in-memory cache? Even without an actual redis backend, the backplane will try to invalide things if possible. So, whenever the Foo instance changes something, the Bar instance will get notified via the backplane.
If you don't want that, you can configure different backplane channel names.
I have 2
ICacheManager
instances,ICacheManager<Foo>
andICacheManager<Bar>
. One is a typical in-memory handle+Redis handle+backplane setup, the other is in-memory handle only with Redis backplane. For the<Foo>
cache manager only, I register with the OnXyz events (OnAdd
,OnPut
,OnRemove
, etc) to just write some log messages when those events happen, including theeventArgs.key
.What's strange is that I'm getting events for both cache manager instances, both
<Foo>
and<Bar>
. In the debugger, I see an event with the Bar keys and thesender
arg is actually theICacheManager<Foo>
instance!I've set a breakpoint at the point where I add my event listeners (
fooCacheManager.OnAdd += ...
) to confirm that it is only being called once, so I'm confused why my little monitor is getting all events for the other instance.