Пример #1
0
 /// <summary>
 /// Revalidate the caches with provided revalidateKeys
 /// </summary>
 /// <param name="revalidatedKeys"></param>
 public static void RevalidateCaches(List <string> revalidatedKeys)
 {
     foreach (var key in revalidatedKeys)
     {
         RevalidateEvent?.Invoke(key);
     }
 }
Пример #2
0
 /// <summary>
 /// Async notify revalidation events
 /// </summary>
 /// <param name="revalidateKeys"></param>
 /// <returns></returns>
 public static Task RevalidateCachesAsync(List <string> revalidateKeys)
 {
     if (RevalidateEvent != null)
     {
         return(Task.WhenAll(
                    revalidateKeys.Select(k => Task.Run(() => { RevalidateEvent?.Invoke(k); }))
                    ));
     }
     return(TaskHelpers.DefaultCompleted);
 }