We have some classes (SiteConfiguration
and ExtensionManager
) that
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 GenerationSynchronizer
class, 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.
SiteConfiguration
and ExtensionManager
have been updated to use this.