public async Task <ScanCursor> ScanAsync(ScanCursor cursor, string match) { var cursorPositionBytes = cursor.CursorPosition.ToBytes(); var bytes = await SendMultipleCommandAsync(RedisCommands.Scan, cursorPositionBytes, "MATCH".ToBytes(), match.ToBytes()).ConfigureAwait(false); return(ConvertToScanCursor(bytes)); }
public async Task <ScanCursor> ScanAsync(ScanCursor cursor, int count) { var countBytes = count.ToBytes(); var cursorPositionBytes = cursor.CursorPosition.ToBytes(); var bytes = await SendMultipleCommandAsync(RedisCommands.Scan, cursorPositionBytes, "COUNT".ToBytes(), countBytes).ConfigureAwait(false); return(ConvertToScanCursor(bytes)); }
private static GeoPosition GetGeoPosition(byte[] positionPart) { var positionCursor = new ScanCursor(0, positionPart); var positionSubParts = positionCursor.GetStringValues().ToArray(); var longitude = double.Parse(positionSubParts[0]); var latitude = double.Parse(positionSubParts[1]); return(new GeoPosition(longitude, latitude)); }
public async Task <ScanCursor> SetScanAsync(string setKey, ScanCursor cursor) { CheckSetKey(setKey); var cursorPositionBytes = cursor.CursorPosition.ToBytes(); var bytes = await SendMultipleCommandAsync(RedisCommands.SetScan, setKey.ToBytes(), cursorPositionBytes).ConfigureAwait(false); return(ConvertToScanCursor(bytes)); }
public async Task <HashScanCursor> HashScanAsync(string hashKey, ScanCursor cursor, string match) { CheckKey(hashKey); var cursorPositionBytes = cursor.CursorPosition.ToBytes(); var bytes = await SendMultipleCommandAsync(RedisCommands.HashScan, hashKey.ToBytes(), cursorPositionBytes, "MATCH".ToBytes(), match.ToBytes()).ConfigureAwait(false); return(ConvertToHashScanCursor(bytes)); }
public async Task <ScanCursor> SetScanAsync(string setKey, ScanCursor cursor, string match, int count) { CheckSetKey(setKey); var countBytes = count.ToBytes(); var cursorPositionBytes = cursor.CursorPosition.ToBytes(); var bytes = await SendMultipleCommandAsync(RedisCommands.SetScan, setKey.ToBytes(), cursorPositionBytes, "MATCH".ToBytes(), match.ToBytes(), "COUNT".ToBytes(), countBytes).ConfigureAwait(false); return(ConvertToScanCursor(bytes)); }