container
container copied to clipboard
Create TimeControlledLifetimeManager
Description
A TimeControlledLifetimeManager is a manager that holds value only certain amount of time.
Problem
Caching time sensitive information, such as security tokens, is an involved process. Automating the whole thing is even more involved.
Solution
This lifetime controller alone with the ability to register a factory, should solve some of the complexity. The manager should operate like this:
- When created, the
TimeControlledLifetimeManagershould take a time span for the information to be valid. - When set, the manager also sets the time
- When value is requested, the manager checks if request is within valid time span and if yes, returns the value
- If valid time already elapsed, it returns
NoValueforcing resolution of the new value
Impact
None.