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
                    
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="Cruma.Tron.Runner" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cruma.Tron.Runner" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Cruma.Tron.Runner" />
                    
Project file
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 Cruma.Tron.Runner --version 0.1.0
                    
#r "nuget: Cruma.Tron.Runner, 0.1.0"
                    
#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 Cruma.Tron.Runner@0.1.0
                    
#: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=Cruma.Tron.Runner&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Cruma.Tron.Runner&version=0.1.0
                    
Install as a Cake Tool

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 with ReportPendingAsync. A secret directory that does not exist is created 0700; an existing one that group or others can access is refused with InsecureSecretDirectoryException (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 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

    • 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