Ruvio.Client 0.2.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ruvio.Client --version 0.2.5
                    
NuGet\Install-Package Ruvio.Client -Version 0.2.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ruvio.Client" Version="0.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ruvio.Client" Version="0.2.5" />
                    
Directory.Packages.props
<PackageReference Include="Ruvio.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ruvio.Client --version 0.2.5
                    
#r "nuget: Ruvio.Client, 0.2.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ruvio.Client@0.2.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ruvio.Client&version=0.2.5
                    
Install as a Cake Addin
#tool nuget:?package=Ruvio.Client&version=0.2.5
                    
Install as a Cake Tool

Ruvio.Client

RESP2 client for Ruvio. Connecting does not send CLIENT SETINFO or HELLO. The typed methods cover every command in docs/compatibility-matrix.json and the options that change what Ruvio does. FLUSHDB ASYNC (it runs synchronously) and HELLO AUTH/SETNAME have no typed form. Anything else can go through ExecuteAsync with the same argument lists as redis-cli.

Reads start with Get. Writes use the mutation: Set, Add, Remove, Delete, Increment. A range that returns values is GetSortedSetRangeByRankWithScoresAsync.

using Ruvio.Client;

await using var db = await RuvioClient.ConnectAsync("127.0.0.1", 6379);
await db.SubscribeAsync("news", msg => Console.WriteLine(msg.Payload));
await db.PublishAsync("news", "hello");
await db.AddSortedSetAsync("leaderboard", ("player2", 50), ("player1", 100));
IReadOnlyList<SortedSetEntry> rows = await db.GetSortedSetRangeByRankWithScoresAsync(
    "leaderboard",
    0,
    -1,
    descending: true);

Connecting

Give the client one address. On connect it sends CLUSTER SLOTS. A standalone server replies with an error and the client keeps that one socket. A sharded server returns the slot map; the client then opens one socket per shard and sends each command to the shard that owns the key. MOVED refreshes the map and retries. Multi-key reads and writes (MGET, MSET, DEL, UNLINK, EXISTS, TOUCH) are split by slot and merged. FLUSHDB, FLUSHALL, and DBSIZE go to every shard.

await using var cluster = await RuvioClient.ConnectAsync("127.0.0.1", 6379);
await cluster.SetAsync("session:ada", "hello");
await cluster.SetAsync("somekey", "on-another-shard");
IReadOnlyList<string?> values = await cluster.GetManyAsync("session:ada", "somekey");

RuvioClient.GetHashSlot(key) is the same 0–16383 slot Ruvio uses, including {hash tags}. Set RuvioClientOptions.DiscoverCluster to false to stay on the seed socket.

A standalone client is still one TCP connection bound to one logical database. Pick the database when you connect and use the client as that database:

await using var cache = await RuvioClient.ConnectAsync("127.0.0.1", 6379, database: 2);
await using var sessions = await RuvioClient.ConnectAsync(IPAddress.Loopback, 6379, database: 3);
await using var main = await RuvioClient.ConnectAsync(new IPEndPoint(IPAddress.Parse("10.0.0.5"), 6379));

await using var secured = await RuvioClient.ConnectAsync(new RuvioClientOptions
{
    Host = "10.0.0.5",
    Port = 6379,
    Username = "app",
    Password = "secret",
    Database = 4,
    ConnectTimeout = TimeSpan.FromSeconds(2),
});

Database 0 sends nothing after AUTH and CLUSTER SLOTS. Any other index sends SELECT after discovery, before ConnectAsync returns. Indexes run from 0 to the server's databases setting minus one (16 by default, at most 256). Cluster mode has only database 0; connecting with another index throws.

SelectAsync and GetDatabaseAsync send SELECT on the same connection; every later command on that client uses the new database. GetDatabaseAsync returns the same client, not a second socket. Open one client per database when two parts of an application need different databases at the same time.

FlushDatabaseAsync, FlushAllDatabasesAsync, SwapDatabasesAsync, and MoveKeyAsync send FLUSHDB, FLUSHALL, SWAPDB, and MOVE. See docs/LOGICAL_DATABASES.md.

Options

Command Methods
SET SetAsync (PX, NX, XX), SetAsync(key, value, DateTimeOffset) (PXAT), SetKeepingTimeToLiveAsync (KEEPTTL), SetAndGetAsync (GET)
LPOP / RPOP one element or a count
SPOP / SRANDMEMBER one member or a count; a negative SRANDMEMBER count may repeat
HSCAN / SCAN MATCH and COUNT
ZADD (member, score) tuples, SortedSetEntry, or one member, score; SortedSetAddFlags: NX, XX, GT, LT, CH; IncrementSortedSetAsync(..., flags) sends INCR
XADD AddStreamEntryAsync(key, id, maxLength, ...) sends MAXLEN
XRANGE / XREVRANGE optional COUNT
XREAD / XREADGROUP StreamReadOptions: COUNT, BLOCK, NOACK (group reads only)
XGROUP CREATE createStream: true sends MKSTREAM
XPENDING summary, or the extended form with IDLE, a range, a count, and a consumer
XCLAIM StreamClaimOptions: IDLE, TIME, RETRYCOUNT, FORCE, LASTID; ClaimStreamEntryIdsAsync sends JUSTID
INFO optional section; prometheus returns Prometheus text
FUNCTION LOAD LoadFunctionAsync(name, body); the body is plain Lua and is lost on restart

A blocking read (BLPOP, XREAD BLOCK, XREADGROUP BLOCK) holds the connection until it returns. Use a separate client for it.

Subscribe opens a second TCP socket. GET / SET / PUBLISH stay on the command socket. Register Message or SubscribeAsync(channel, handler) (StackExchange / Garnet app style), or await foreach ListenAsync. ReadPubSubMessageAsync still works. IsConnected is the command socket. ConnectionFailed fires if a subscriber socket dies.

A password is sent as AUTH only when RuvioClientOptions.Password is set. One client runs commands one at a time. ExecuteManyAsync pipelines several commands on that connection. A server error reply leaves the connection usable. A broken read or write closes it.

0.2.5

  • Pub/Sub uses a dedicated socket. SubscribeAsync(channel, handler), Message, and ListenAsync deliver payloads without a manual read loop on the command connection.
  • IsConnected and ConnectionFailed.

0.2.4

  • DeleteAsync(key) sends DEL for one key. The list overload remains for many keys.
  • PopListLeftBlockingAsync(key, timeout) and PopListRightBlockingAsync(key, timeout) send BLPOP / BRPOP without a key list.

0.2.3

  • A MOVED reply after a plain connect (or with discovery off) learns the slot map and retries, so SET on the seed port no longer throws.

0.2.2

  • A sharded server is discovered from one seed address. Commands are routed by hash slot, MOVED is followed, and MGET / MSET / DEL split across shards.
  • GetClusterShardsAsync, GetClusterInfoAsync, GetClusterMyIdAsync, GetClusterKeySlotAsync, ReadOnlyAsync, ReadWriteAsync.
  • GetHashSlot, IsCluster, ShardCount, and RuvioClientOptions.DiscoverCluster.

0.2.1

  • AddSortedSetAsync(key, ("ada", 100), ("bob", 50)) takes (member, score) tuples, with or without SortedSetAddFlags.
  • AddSortedSetAsync(key, member, score) adds one member and returns whether it was new.

0.2.0

  • ConnectAsync(host, port, database), ConnectAsync(IPAddress, port, database), ConnectAsync(IPEndPoint, database), and RuvioClientOptions.Database.
  • SelectAsync, GetDatabaseAsync, FlushDatabaseAsync, FlushAllDatabasesAsync, SwapDatabasesAsync, MoveKeyAsync.
  • The option overloads in the table above, and PingAsync(message).
  • Breaking: LoadFunctionAsync(body) became LoadFunctionAsync(name, body). The old form sent a request Ruvio always refused. DeleteFunctionAsync returns Task<bool>.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Ruvio.Client:

Package Downloads
Ruvio.Client.AspNetCore

ASP.NET Core integration for the Ruvio.Client RESP2 SDK.

Ruvio.Extensions.Caching

Binary-safe IDistributedCache integration for Ruvio.

Ruvio.AspNetCore.RateLimiting

Opt-in distributed fixed-window HTTP rate limiting backed by Ruvio.

Ruvio.AspNetCore.DataProtection

Append-only ASP.NET Core Data Protection key-ring storage on Ruvio.

Ruvio.AspNetCore.OutputCaching

Binary ASP.NET Core output caching with distributed tag invalidation on Ruvio.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 37 10/10/2026
0.3.0 39 10/9/2026
0.2.13 106 10/5/2026
0.2.12 105 10/2/2026
0.2.11 103 10/2/2026
0.2.10 103 10/2/2026
0.2.9 178 10/2/2026
0.2.8 97 10/1/2026
0.2.7 97 9/30/2026
0.2.6 109 9/26/2026
0.2.5 115 9/26/2026
0.2.4 102 9/26/2026
0.2.3 107 9/26/2026
0.2.2 115 9/25/2026
0.2.1 116 9/25/2026
0.2.0 103 9/25/2026
0.1.3 96 9/23/2026
0.1.2 90 9/23/2026
0.1.1 103 9/23/2026
0.1.0 90 9/23/2026