Chattel-AssetTools
3.0.0
dotnet add package Chattel-AssetTools --version 3.0.0
NuGet\Install-Package Chattel-AssetTools -Version 3.0.0
<PackageReference Include="Chattel-AssetTools" Version="3.0.0" />
<PackageVersion Include="Chattel-AssetTools" Version="3.0.0" />
<PackageReference Include="Chattel-AssetTools" />
paket add Chattel-AssetTools --version 3.0.0
#r "nuget: Chattel-AssetTools, 3.0.0"
#:package Chattel-AssetTools@3.0.0
#addin nuget:?package=Chattel-AssetTools&version=3.0.0
#tool nuget:?package=Chattel-AssetTools&version=3.0.0
Chattel
Chattel reads and writes immutable Halcyon assets through local disk and WHIP asset servers. Chattel 3 targets .NET 10 and .NET 11. Cloud Files support has been removed; see CHANGELOG.md for migration details.
Install the Chattel NuGet package for storage. Chattel-AssetTools adds JPEG and
JPEG 2000 decoding through CoreJ2K/SkiaSharp; asset.ToImage() returns an owned
SKBitmap that the caller disposes. Version 3.0.0 is in development and has not
been published by this modernization.
The reader checks local storage, then upstream server groups in order, querying
each group's servers in parallel and returning the first successful response.
Replica failures do not hide a healthy response. A group falls back when all its
servers finish without an asset or its deadline expires. Set
ChattelConfiguration.ReadGroupTimeout before creating the reader; the default
is 30 seconds per group. If no group succeeds, failures/timeouts throw; reads
that receive only missing responses return null. Successful remote reads can
populate local storage. The writer stores locally and attempts upstream delivery. When configured
with both local storage and an upstream, the write cache tracks unfinished
uploads for replay when the writer is reconstructed. Asset content is protobuf;
the local tree and write-cache formats remain compatible with legacy assets.
Applications supply configuration and choose logging through LibLog.
Run the following local-storage example with
mise exec -- dotnet run --project samples/Chattel.QuickStart (from the Halcyon repository root). Its source is compiled
as part of the solution:
using System;
using System.IO;
using Chattel;
using Chattel.Stratus;
var directory = Directory.CreateTempSubdirectory("chattel-example-");
try
{
var config = new ChattelConfiguration(directory.FullName);
var writer = new ChattelWriter(config);
var reader = new ChattelReader(config);
var asset = new StratusAsset
{
Id = Guid.NewGuid(), Name = "example", Description = "local asset",
CreateTime = DateTime.UtcNow, Data = new byte[] { 1, 2, 3 }
};
await writer.PutAssetAsync(asset);
var loaded = await reader.GetAssetAsync(asset.Id);
if (loaded == null || !asset.Equals(loaded)) throw new InvalidOperationException("Round trip failed.");
Console.WriteLine($"Read {loaded!.Data.Length} bytes");
// Compatibility callback completes on the calling thread before returning,
// including when joining an active read. Use the task overload to avoid blocking.
reader.GetAssetAsync(asset.Id, result => Console.WriteLine(result?.Name));
}
finally
{
directory.Delete(true);
}
For WHIP, create AssetServerWHIP with a title, host, port and password, and pass
it to ChattelConfiguration. For recovery, use its constructor accepting an
existing local directory, write-cache file path, record capacity (at least two),
and upstream. Dispose the server after all operations have completed. The legacy
WHIP client still has blocking startup/send/write operations; task-based reads
wait through its callback. Read-group deadlines permit fallback and retry but do
not abort outstanding transport requests. A missing read returns null. Cancellation stops a
caller's wait; it does not roll back an accepted write. Keep the writer, backend
and asset alive and stable until the accepted operation finishes.
Chattel is developed inside the Halcyon repository (ADR 0026), next to the WHIP client
it uses (src/Halcyon.Whip.Client) and Halcyon, its main consumer. Build and test
from the repository root:
mise install
mise run build
mise run test
mise run test:integration
mise run pack
mise exec -- dotnet run --project samples/Chattel.QuickStart
Unit tests need no external services. Integration tests use isolated temporary
directories and Testcontainers to build and start the real C++ WHIP server from
pinned upstream source. Docker with Linux containers and internet access are
required; the first build can take several minutes. A server build or startup
failure fails the suite. Packages and symbols go to artifacts/packages.
Releases are published from the Halcyon repository by a tag (chattel/v3.0.0); see
docs/chattel/releasing.md there. Architecture records are in docs/chattel/adr.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Chattel (>= 3.0.0)
- CoreJ2K (>= 2.4.1.108)
- CoreJ2K.Skia (>= 2.4.1.108)
- protobuf-net (>= 3.4.40)
- SkiaSharp (>= 3.119.4)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 3.119.4)
-
net11.0
- Chattel (>= 3.0.0)
- CoreJ2K (>= 2.4.1.108)
- CoreJ2K.Skia (>= 2.4.1.108)
- protobuf-net (>= 3.4.40)
- SkiaSharp (>= 3.119.4)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 3.119.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.