Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the old MapCache with an LRUCache. The MapCache was a simple implementation that was not a true cache; it simply was a map. We relied on the controller and other users to delete invocations and workflows to avoid OOMs. The new LRUCache is a true cache, which evicts entities when it reaches the size limit. The old MapCache is moved to the testutils package since it still makes a good candidate for test and development purposes.
To ensure that entities can still be accessed, even when they are evicted from the cache, this PR also introduces the LoadingCache (a partial implementation was in the codebase, but unused). The LoadingCache allows cache consumers to setup a fallback on a cache miss. In this systems case the fallback of the LoadingCache is to reach directly into the event store to fetch the relevant events.