コード例 #1
0
 public static async IAsyncEnumerable <string> GetKeysStartingWithAsync(this ICacheClientAsync cache, string prefix)
 {
     await foreach (var key in cache.GetKeysByPatternAsync(prefix + "*"))
     {
         yield return(key);
     }
 }
コード例 #2
0
#pragma warning disable CS8425
        public async IAsyncEnumerable <string> GetKeysByPatternAsync(string pattern, CancellationToken token = default)
        {
            await foreach (var key in cache.GetKeysByPatternAsync(EnsurePrefix(pattern), token))
            {
                yield return(key);
            }
        }
コード例 #3
0
 public static async IAsyncEnumerable <string> GetAllKeysAsync(this ICacheClientAsync cache)
 {
     await foreach (var key in cache.GetKeysByPatternAsync("*"))
     {
         yield return(key);
     }
 }
コード例 #4
0
 public static IAsyncEnumerable <string> GetKeysByPatternAsync(this ICacheClientAsync cache, string pattern)
 {
     return(cache.GetKeysByPatternAsync(pattern));
 }
コード例 #5
0
 public async Task <IEnumerable <string> > GetKeysByPatternAsync(string pattern, CancellationToken token = default)
 {
     return(await cache.GetKeysByPatternAsync(EnsurePrefix(pattern), token).ConfigAwait());
 }
コード例 #6
0
 public static async Task <IEnumerable <string> > GetKeysStartingWithAsync(this ICacheClientAsync cache, string prefix)
 {
     return(await cache.GetKeysByPatternAsync(prefix + "*"));
 }
コード例 #7
0
 public static async Task <IEnumerable <string> > GetAllKeysAsync(this ICacheClientAsync cache)
 {
     return(await cache.GetKeysByPatternAsync("*"));
 }