Fluxum.Sdk
0.2.1
dotnet add package Fluxum.Sdk --version 0.2.1
NuGet\Install-Package Fluxum.Sdk -Version 0.2.1
<PackageReference Include="Fluxum.Sdk" Version="0.2.1" />
<PackageVersion Include="Fluxum.Sdk" Version="0.2.1" />
<PackageReference Include="Fluxum.Sdk" />
paket add Fluxum.Sdk --version 0.2.1
#r "nuget: Fluxum.Sdk, 0.2.1"
#:package Fluxum.Sdk@0.2.1
#addin nuget:?package=Fluxum.Sdk&version=0.2.1
#tool nuget:?package=Fluxum.Sdk&version=0.2.1
Fluxum C# SDK
The async/await .NET client for the
Fluxum realtime database (SPEC-011,
T7.6), distributed as the Fluxum.Sdk NuGet package. No third-party
dependencies — the SDK carries its own minimal MessagePack codec and FluxBIN
row reader.
dotnet add package Fluxum.Sdk
using Fluxum.Sdk;
await using var db = await Connection.ConnectAsync(
"fluxum://127.0.0.1:15801",
System.Text.Encoding.UTF8.GetBytes("my-token"),
tables); // from `fluxum generate --lang csharp`
await db.SubscribeAsync(new[] { "SELECT * FROM ChatMessage" });
await db.CallReducerAsync("send_chat", new object?[] { 1, "hello" });
// TxUpdates land in db.Cache; read db.Cache.Rows("ChatMessage").
What you get
Connection— one session over FluxRPC/TCP: authenticate, subscribe (each query'sInitialDatapopulates a local row cache), call reducers, and receiveTxUpdatediffs on the same socket. Every operation isasyncand takes aCancellationToken.- Transparent reconnect (SDK-047): on connection loss the client reconnects, re-authenticates, resubscribes every active query and reconciles its cache — the application keeps its handle across the outage.
- A per-table row cache keyed by primary key, with per-query ownership so
an
UnsubscribeAsyncdrops only the rows that query held (SDK-044). - Idiomatic errors: a server failure is a
FluxumExceptioncarrying the stable SPEC-028Code(andCatalogname for anErrorframe).
Typed bindings
Generate typed row records and reducer wrappers from a running server's
schema (or a saved schema.json):
fluxum generate --lang csharp --schema http://127.0.0.1:15800 --out ./FluxumGen
This emits Tables.cs (a record row + <Table>Codec.Decode + the cache
hook <Table>Codec.TableSchema() per table) and Reducers.cs (a static
async Task <Reducer>(...) per client-callable reducer), namespace
FluxumGen. Offline generation from a saved schema produces byte-identical
output (SPEC-011 acceptance 11).
Testing
The SDK is validated by the shared conformance corpus
(tests/conformance/)
— the same declarative
scenarios every Fluxum SDK runs against the same server build (TST-052). The
runner boots a fresh fluxum-server per scenario, so build it first:
cargo build -p fluxum-server
cd sdks/csharp && dotnet test Fluxum.Sdk.Tests/Fluxum.Sdk.Tests.csproj
| 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. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.