AsyncRequestReply 0.1.0
See the version list below for details.
dotnet add package AsyncRequestReply --version 0.1.0
NuGet\Install-Package AsyncRequestReply -Version 0.1.0
<PackageReference Include="AsyncRequestReply" Version="0.1.0" />
<PackageVersion Include="AsyncRequestReply" Version="0.1.0" />
<PackageReference Include="AsyncRequestReply" />
paket add AsyncRequestReply --version 0.1.0
#r "nuget: AsyncRequestReply, 0.1.0"
#:package AsyncRequestReply@0.1.0
#addin nuget:?package=AsyncRequestReply&version=0.1.0
#tool nuget:?package=AsyncRequestReply&version=0.1.0
AsyncRequestReply
AsyncRequestReply is a minimal ASP.NET Core library for the Asynchronous Request-Reply pattern.
It lets an HTTP endpoint accept work, enqueue it, return 202 Accepted immediately, and expose a polling endpoint where clients can check the job status later. The library owns the HTTP pattern and status contract. The host application owns the real business processing.
This first version uses in-memory queue and status store implementations. Redis, Hangfire, MassTransit, or any durable transport can be added later by replacing the public interfaces.
Local package installation
Build the NuGet package locally:
dotnet pack src/AsyncRequestReply/AsyncRequestReply.csproj -c Release
Install it from the generated package folder:
dotnet add package AsyncRequestReply --source ./src/AsyncRequestReply/bin/Release
ASP.NET Core configuration
using AsyncRequestReply;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAsyncRequestReply(options =>
{
options.StatusBasePath = "/async-status";
options.ExposeStatusEndpoint = true;
});
builder.Services.AddSingleton<IAsyncJobProcessor, OrderProcessor>();
var app = builder.Build();
app.MapAsyncRequestReplyStatusEndpoints();
app.MapPost("/orders", () => Results.NoContent())
.AsAsyncRequestReply(options => options.PayloadPath = "data");
app.Run();
If no IAsyncJobProcessor is registered, accepted jobs remain in queued until a host application provides processing.
Async endpoint
The endpoint marked with .AsAsyncRequestReply(...) reads the request body, extracts the configured payload, stores the initial status, enqueues the job, and returns:
{
"id": "{jobId}",
"status": "queued",
"location": "/async-status/status/{jobId}"
}
The HTTP response status is 202 Accepted and the Location header contains the polling URL.
With PayloadPath = "data", this request enqueues only the nested data object:
{
"data": {
"name": "order-1"
}
}
Processor example
using AsyncRequestReply;
public sealed class OrderProcessor : IAsyncJobProcessor
{
public Task<object?> ProcessAsync(string jobId, object? payload, CancellationToken cancellationToken = default)
{
return Task.FromResult<object?>(new
{
message = "Order processed",
jobId,
payload
});
}
}
Successful processors move the job to completed. Exceptions move the job to failed and store the exception message in error.
Status endpoint
Register status polling with:
app.MapAsyncRequestReplyStatusEndpoints();
Default route:
GET /async-status/status/{jobId}
Response body:
{
"id": "{jobId}",
"status": "queued",
"result": null,
"error": null,
"createdAt": "2026-06-08T00:00:00+00:00",
"updatedAt": "2026-06-08T00:00:00+00:00"
}
Supported statuses are queued, processing, waiting_external, completed, failed, and not_found.
Commands
dotnet build
dotnet test
dotnet pack src/AsyncRequestReply/AsyncRequestReply.csproj -c Release
| 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.