/
IRedisSortedSet.Generic.Async.cs
50 lines (46 loc) · 3.16 KB
/
IRedisSortedSet.Generic.Async.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// https://github.com/ServiceStack/ServiceStack.Redis
// ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system
//
// Authors:
// Demis Bellot Async(demis.bellot@gmail.com, CancellationToken token = default)
//
// Copyright 2017 ServiceStack, Inc. All Rights Reserved.
//
// Licensed under the same terms of ServiceStack.
//
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ServiceStack.Model;
namespace ServiceStack.Redis.Generic;
public interface IRedisSortedSetAsync<T> : IAsyncEnumerable<T>, IHasStringId
{
ValueTask<int> CountAsync(CancellationToken token = default);
ValueTask AddAsync(T item, double score, CancellationToken token = default);
ValueTask<T> PopItemWithHighestScoreAsync(CancellationToken token = default);
ValueTask<T> PopItemWithLowestScoreAsync(CancellationToken token = default);
ValueTask<double> IncrementItemAsync(T item, double incrementBy, CancellationToken token = default);
ValueTask<int> IndexOfAsync(T item, CancellationToken token = default);
ValueTask<long> IndexOfDescendingAsync(T item, CancellationToken token = default);
ValueTask<List<T>> GetAllAsync(CancellationToken token = default);
ValueTask<List<T>> GetAllDescendingAsync(CancellationToken token = default);
ValueTask<List<T>> GetRangeAsync(int fromRank, int toRank, CancellationToken token = default);
ValueTask<List<T>> GetRangeByLowestScoreAsync(double fromScore, double toScore, CancellationToken token = default);
ValueTask<List<T>> GetRangeByLowestScoreAsync(double fromScore, double toScore, int? skip, int? take, CancellationToken token = default);
ValueTask<List<T>> GetRangeByHighestScoreAsync(double fromScore, double toScore, CancellationToken token = default);
ValueTask<List<T>> GetRangeByHighestScoreAsync(double fromScore, double toScore, int? skip, int? take, CancellationToken token = default);
ValueTask<long> RemoveRangeAsync(int minRank, int maxRank, CancellationToken token = default);
ValueTask<long> RemoveRangeByScoreAsync(double fromScore, double toScore, CancellationToken token = default);
ValueTask<double> GetItemScoreAsync(T item, CancellationToken token = default);
ValueTask<long> PopulateWithIntersectOfAsync(IRedisSortedSetAsync<T>[] setIds, CancellationToken token = default);
ValueTask<long> PopulateWithIntersectOfAsync(params IRedisSortedSetAsync<T>[] setIds); // convenience API
ValueTask<long> PopulateWithIntersectOfAsync(IRedisSortedSetAsync<T>[] setIds, string[] args, CancellationToken token = default);
ValueTask<long> PopulateWithUnionOfAsync(IRedisSortedSetAsync<T>[] setIds, CancellationToken token = default);
ValueTask<long> PopulateWithUnionOfAsync(params IRedisSortedSetAsync<T>[] setIds); // convenience API
ValueTask<long> PopulateWithUnionOfAsync(IRedisSortedSetAsync<T>[] setIds, string[] args, CancellationToken token = default);
ValueTask ClearAsync(CancellationToken token = default);
ValueTask<bool> ContainsAsync(T item, CancellationToken token = default);
ValueTask AddAsync(T item, CancellationToken token = default);
ValueTask<bool> RemoveAsync(T item, CancellationToken token = default);
}