Respsody 0.0.8
dotnet add package Respsody --version 0.0.8
NuGet\Install-Package Respsody -Version 0.0.8
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="Respsody" Version="0.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Respsody" Version="0.0.8" />
<PackageReference Include="Respsody" />
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 Respsody --version 0.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Respsody, 0.0.8"
#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 Respsody@0.0.8
#: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=Respsody&version=0.0.8
#tool nuget:?package=Respsody&version=0.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Respsody
Respsody is an experimental, high-performance, asynchronous, general-purpose RESP3 client library written in C#. It's currently in an early stage of development and intended for experimentation and community feedback.
Quick start
using Respsody;
using Respsody.Resp;
using System.Net;
using System.Text;
using static System.Console;
var clientFactory = new RespClientFactory();
using var client = await clientFactory.Create(new IPEndPoint(IPAddress.Loopback, 6379));
var utf8Key = Key.Utf8("respsody");
Key strKey = "gob_key"; // same as Key.Utf8
var arrKey = Key.ByteArray([1, 0, 1]);
var utf16Key = Key.Unicode("‼️");
await client.Set(utf8Key, Value.Utf8("hello, respsody!"));
await client.Set(arrKey, Value.ByteArray([0, 3, 0, 3, 6, 6]));
await client.Set(strKey, Value.Utf8("we need a gimmick!"));
await client.Set(utf16Key, Value.Unicode("⚡"));
//dispose non-void responses to release underlying buffers
using var getResponse = await client.Get(utf8Key);
WriteLine("- GET result -");
WriteLine(getResponse.ToString());
//for aggregate responses(arrays, maps, sets) dispose only root response
using var mgetResponse = await client.Mget([strKey, utf16Key, arrKey]);
OutputEncoding = Encoding.Unicode;
WriteLine("- MGET result -");
Write("strings: ");
Write(mgetResponse[0].ToRespString());
WriteLine(mgetResponse[1].ToRespString().AsUnicodeSpan());
Write("byte[]: ");
WriteLine($"{string.Join(",", [..mgetResponse[2].ToRespString().GetSpan()])}");
//define and generate commands:
[RespCommand("GET key", ResponseType.String)]
[RespCommand("SET key value", ResponseType.Void)]
[RespCommand("MGET key [key ...]", ResponseType.Array)]
[RespCommand("MSET key value [key value ...]", ResponseType.Void)]
[RespCommand("COMMAND DOCS [command-name:string [command-name:string ...]]", ResponseType.Map)]
public static class Commands;
Cluster usage:
using Respsody.Cluster;
var clusterRouter = new ClusterRouter(
new ClusterRouterOptions
{
SeedEndpoints = ["some_cluster_host1:6379", "some_cluster_host2:6379"],
ClientOptions = new RespClientOptions()
});
await clusterRouter.Initialize();
// execute command on primary node that is responsible for key
using var v1 = await clusterRouter.RouteTo(RolePreference.Primary).Get(Key.Utf8("some_key_1"));
// pick random node and execute COMMAND DOCS on it
using var docs = await clusterRouter.PickRandom().Command(COMMAND.DOCS);
//group objects by node and execute commands on it
(Key Key, Value Value)[] objects = [(Key.Utf8("k_1"), Value.Utf8("v_1")), /* ... */ (Key.Utf8("k_n"), Value.Utf8("v_n"))];
foreach (var (node, nodeObjects)in clusterRouter.RouteTo(RolePreference.Primary).GroupBy(objects, o => o.Key))
await node.Mset(nodeObjects);
Disclaimer
This project is an independent work and is not endorsed, supported, or certified by Redis.
License
This project is licensed under the MIT License.
| Product | Versions 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
- Respsody.Generators (>= 0.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.8 | 133 | 2/16/2026 |
| 0.0.7 | 119 | 2/16/2026 |
| 0.0.6 | 162 | 12/21/2025 |
| 0.0.5 | 461 | 12/10/2025 |
| 0.0.4-alpha | 169 | 8/22/2025 |
| 0.0.3-alpha | 228 | 8/8/2025 |
| 0.0.2-alpha | 261 | 8/4/2025 |
| 0.0.1-alpha | 179 | 8/3/2025 |