Cruma.Tron.Runner
0.1.0
dotnet add package Cruma.Tron.Runner --version 0.1.0
NuGet\Install-Package Cruma.Tron.Runner -Version 0.1.0
<PackageReference Include="Cruma.Tron.Runner" Version="0.1.0" />
<PackageVersion Include="Cruma.Tron.Runner" Version="0.1.0" />
<PackageReference Include="Cruma.Tron.Runner" />
paket add Cruma.Tron.Runner --version 0.1.0
#r "nuget: Cruma.Tron.Runner, 0.1.0"
#:package Cruma.Tron.Runner@0.1.0
#addin nuget:?package=Cruma.Tron.Runner&version=0.1.0
#tool nuget:?package=Cruma.Tron.Runner&version=0.1.0
Cruma.Tron.Runner
The .NET runner SDK for Tron. It connects your process to Tron over a
WebSocket with a worker API key, receives the jobs Tron pushes to your handlers, accepts them, and reports the
result as Outcome.Ok(...) or Outcome.Err(...).
Protocol messages are generated from Tron's published AsyncAPI document; the SDK holds no hand-written wire model.
using Cruma.Tron.Runner;
await using var runner = new RunnerClient(new RunnerClientOptions
{
TronUrl = new Uri(Environment.GetEnvironmentVariable("TRON_URL")!),
Token = Environment.GetEnvironmentVariable("TRON_WORKER_KEY")!,
SecretDirectory = Environment.GetEnvironmentVariable("TRON_SECRET_DIR")!,
});
runner.Handle("send-report", (delivery, cancellationToken) =>
{
// Ok marks the run succeeded and Err marks it failed; both carry a message.
return Task.FromResult(Outcome.Ok($"sent the report for {delivery.JobName}"));
});
await runner.ConnectAsync();
// ... keep the process alive; when it is told to shut down:
await runner.StopAsync(); // finish in-flight work, report it, then close
- Reconnects after a lost connection with a capped backoff and announces again.
- Accepts each delivery immediately, then runs your handler; a handler that throws is reported as
Err. - Keeps each delivery's secret in an
ISecretStore(a file per delivery, mode 0600, by default) until Tron records the report, so a restarted process can still report withReportPendingAsync. A secret directory that does not exist is created 0700; an existing one that group or others can access is refused withInsecureSecretDirectoryException(the SDK never changes permissions on a directory it did not create). - Typed refusals:
AcceptRefusedException,ReportRejectedException,ConnectFailedException,ProtocolViolationException.
Routing: register one handler per key with Handle(key, handler); each work frame names the handler it was
dispatched for (HandlerKey) and the SDK runs that handler. A delivery whose key has no registered handler is not
accepted and raises UnknownHandlerException (with DeliveryId and HandlerKey) through Faulted.
| 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.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 0 | 11/21/2026 |