Add a class for synchronizing generation IDs across processes.
Review Request #7942 — Created Feb. 4, 2016 and submitted
We have some classes (
need to synchronize an ID representing a generation of their state
across processes, so that if one process changes some state, the others
will reload from the database. We've left it up to those classes in the
past to do this, but that meant logic and code was getting duplicated,
and any future classes that needed this behavior would have to duplicate
it as well.
This introduces a
GenerationSynchronizerclass, which handles the
synchronization and expiration checking of a generation ID. This can
easily be used by classes that need this sort of behavior, without
having to add a lot of new code.
ExtensionManagerhave been updated to use this.
All unit tests pass.
Played around with the functionality in Review Board. Didn't see any
Made normalizing the cache key optional.
Revision 2 (+214 -43)