Respsody 0.0.2-alpha
This is a prerelease version of Respsody.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Respsody --version 0.0.2-alpha
NuGet\Install-Package Respsody -Version 0.0.2-alpha
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.2-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Respsody" Version="0.0.2-alpha" />
<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.2-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Respsody, 0.0.2-alpha"
#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.2-alpha
#: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.2-alpha&prerelease
#tool nuget:?package=Respsody&version=0.0.2-alpha&prerelease
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;
var clientFactory = new RespClientFactory();
var client = await clientFactory.Create(new IPEndPoint(IPAddress.Loopback, 6379));
await client.Set(Key.Utf8("my_byte_array_key"), Value.ByteArray([0, 3, 0, 3, 6, 6]));
await client.Set(Key.Utf8("my_gob_key"), Value.Utf8("goblins are better than trolls."));
//**always** dispose non-void responses and do it exactly once
using var getResponse = await client.Get(Key.Utf8("my_byte_array_key"));
//for aggregate responses(arrays, maps, sets, pushes) dispose only root response
using var mgetResponse = await client.Mget([Key.Utf8("my_byte_array_key"), Key.Utf8("my_string_key")]);
var arr = mgetResponse[0].ToRespString().GetSpan().ToArray();
var str = mgetResponse[1].ToRespString().ToString(Encoding.UTF8);
//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.2-alpha)
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 | 135 | 2/16/2026 |
| 0.0.7 | 123 | 2/16/2026 |
| 0.0.6 | 163 | 12/21/2025 |
| 0.0.5 | 463 | 12/10/2025 |
| 0.0.4-alpha | 172 | 8/22/2025 |
| 0.0.3-alpha | 230 | 8/8/2025 |
| 0.0.2-alpha | 262 | 8/4/2025 |
| 0.0.1-alpha | 180 | 8/3/2025 |