Welcome to Hugo, a library bringing Go-style concurrency primitives and functional result pipelines to .NET 10.
Hugo provides:
- Go-inspired primitives:
WaitGroup,Mutex,RwMutex, channels, and select operations - Railway-oriented programming:
Result<T>pipelines with functional combinators - Deterministic workflows: Replay-safe orchestration with version gates and effect stores
- Observability: Built-in OpenTelemetry integration with schema-aware metrics
- Task queues: Cooperative leasing with heartbeats and automatic requeuing
Learning-oriented guides that teach Hugo concepts through hands-on examples.
Task-oriented recipes for specific scenarios like fan-in workflows, retry policies, and observability setup.
Comprehensive API documentation including concurrency primitives, result pipelines, and diagnostics.
Understanding-oriented discussions about design decisions and architectural principles.
dotnet add package Hugo
dotnet add package Hugo.Diagnostics.OpenTelemetryusing Hugo;
using static Hugo.Go;
var channel = MakeChannel<string>(capacity: 10);
var workers = new WaitGroup();
workers.Go(async () =>
{
using var _ = Defer(() => channel.Writer.TryComplete());
await channel.Writer.WriteAsync("hello", cancellationToken);
});
await foreach (var value in channel.Reader.ReadAllAsync(cancellationToken))
{
var result = Ok(value)
.Ensure(text => !string.IsNullOrWhiteSpace(text))
.Map(text => text.ToUpperInvariant());
if (result.IsSuccess)
Console.WriteLine(result.Value);
}
await workers.WaitAsync(cancellationToken);