Skip to content

marklauter/plumber

Repository files navigation

.NET Tests .NET Publish NuGet Nuget

Plumber MSL Armory

Plumber

Another weapon from the MSL Armory

Middleware pipelines for host-free .NET projects. Plumber brings the ASP.NET Core middleware model — a request, a response, and a chain of steps with dependency injection and configuration — to .NET projects that run without a host: console apps, AWS Lambdas, Azure Functions, queue consumers, file processors, and similar workloads.

The wiki is the full documentation: concepts, a tutorial, per-type reference, and deployment recipes.

Packages

  • MSL.Plumber.Pipeline — the core builder, handler, middleware, and request context. See Pipeline.
  • MSL.Plumber.Pipeline.TestingPlumberApplicationFactory for exercising a real pipeline in tests. See Testing.
  • MSL.Plumber.Serilog.Extensions — per-request Serilog request logging. See Serilog Extensions.
  • MSL.Plumber.Diagnostics — per-request OpenTelemetry tracing and metrics middleware. See Diagnostics.

Install

dotnet add package MSL.Plumber.Pipeline

Plumber targets .NET 10.

Hello, World

using Plumber;

using var handler = RequestHandlerBuilder
    .Create<string, string>()
    .Build();

handler.Use((context, next) =>
{
    context.Response = $"Hello, {context.Request}!";
    return next(context);
});

var greeting = await handler.InvokeAsync("World");
Console.WriteLine(greeting); // Hello, World!

A Plumber application has four pieces: a builder, the handler it builds, one or more middleware, and an InvokeAsync call. Each invocation gets its own dependency injection scope and cancellation token.

Where to go next

  • New to middleware pipelines? Start with Concepts, then the Tutorial.
  • Know the shape already? Jump into Building a pipeline, Middleware, and Request lifecycle.
  • Looking for a specific scenario? Browse the recipes — AWS Lambda, Azure Functions, queue consumers, webhooks, and more — from the wiki home.
  • Migrating from an earlier version? See Migration. v5 makes no breaking changes; v4 and v3 are covered with before-and-after examples.

Repository · NuGet — Pipeline · NuGet — Testing · MIT License · Report an issue

About

A request-response middleware pipeline for dotnet

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages