Skip to content

ICacheManager OnXyz event wires getting crossed #310

@erizzo

Description

@erizzo

I have 2 ICacheManager instances, ICacheManager<Foo> and ICacheManager<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 the eventArgs.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 the sender arg is actually the ICacheManager<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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions