Context:
Multiple producers forwarding connection messages to multiple consumers.
Not all consumer channels exist, in those cases messages go to storage.
While a consumer channel is spun up, producers are paused via RWMutex;
  during pause, channel is populated from storage.
Shared locks (RLock) are held by producers, exclusive lock by consumer.
RWMutex objects live in a global map[string]*RWMutex.

Problem:
Many consumer channels don't get spun up for days on end.
Many consumer channels don't get new msgs for days on end.
How should we delete old RWMutex objects from the map?

One option:
Bundle a timer with the RWMutex and reset it on each RLock();
  when it expires, delete the map[string] entry.

Other ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to