ReferenceManager
Utility class to safely share instances of a certain type across multiple threads, while periodically refreshing them. This class ensures each reference is closed only once all threads have finished using it. It is recommended to consult the documentation of ReferenceManager implementations for their maybeRefresh semantics.
Type Parameters
Inheritors
Types
Functions
Adds a listener, to be notified when a reference is refreshed/swapped.
Closes this ReferenceManager to prevent future acquire acquiring. A reference manager should be closed if the reference to the managed resource should be disposed or the application using the ReferenceManager is shutting down. The managed resource might not be released immediately, if the ReferenceManager user is holding on to a previously acquire acquired reference. The resource will be released once when the last reference is release released. Those references can still be used as if the manager was still active.
You must call this (or maybeRefreshBlocking), periodically, if you want that will return refreshed instances.
You must call this (or maybeRefresh), periodically, if you want that will return refreshed instances.
Removes a listener added by addListener.