using System;
using System.Collections.Immutable;
namespace OpenTap
{
/// Cache class which clears when a certain criteria is met.
internal class Cache
{
// using immutable dictionary to avoid issues with race conditions.
// note that for caches data races are not that important.
ImmutableDictionary dict = ImmutableDictionary.Empty;
// this function returns an object which is used for checking if the cache should be cleared.
readonly Func