Ejemplo n.º 1
0
 public ResponseData DoRangByScore(RequestType type, string key, double min = double.MinValue, double max = double.MaxValue, RangType rangType = RangType.None, long offset = -1, int count = 20, bool withScore = false)
 {
     lock (_syncLocker)
     {
         key.KeyCheck();
         RedisCoder.CoderForRandByScore(type, key, min, max, rangType, offset, count, withScore);
         var result = RedisCoder.Decoder();
         if (result.Type == ResponseType.Redirect)
         {
             return((ResponseData)OnRedirect.Invoke(result.Data, OperationType.DoRangByScore, type, key, min, max, rangType, offset, count, withScore));
         }
         else
         {
             return(result);
         }
     }
 }
Ejemplo n.º 2
0
 public async Task <ResponseData> DoRangByScoreAsync(TimeSpan timeSpan, RequestType type, string key, double min = double.MinValue, double max = double.MaxValue, RangType rangType = RangType.None, long offset = -1, int count = 20, bool withScore = false)
 {
     return(await TaskHelper.Run(() =>
     {
         lock (_syncLocker)
         {
             key.KeyCheck();
             RedisCoder.CoderForRandByScore(type, key, min, max, rangType, offset, count, withScore);
             var result = RedisCoder.Decoder();
             if (result.Type == ResponseType.Redirect)
             {
                 return (ResponseData)OnRedirect.Invoke(result.Data, OperationType.DoRangByScore, type, key, min, max, rangType, offset, count, withScore);
             }
             else
             {
                 return result;
             }
         }
     }).WithCancellationTimeout(timeSpan));
 }