Streamix.AspNetCore
1.1.0
dotnet add package Streamix.AspNetCore --version 1.1.0
NuGet\Install-Package Streamix.AspNetCore -Version 1.1.0
<PackageReference Include="Streamix.AspNetCore" Version="1.1.0" />
<PackageVersion Include="Streamix.AspNetCore" Version="1.1.0" />
<PackageReference Include="Streamix.AspNetCore" />
paket add Streamix.AspNetCore --version 1.1.0
#r "nuget: Streamix.AspNetCore, 1.1.0"
#:package Streamix.AspNetCore@1.1.0
#addin nuget:?package=Streamix.AspNetCore&version=1.1.0
#tool nuget:?package=Streamix.AspNetCore&version=1.1.0
Streamix.AspNetCore
ASP.NET Core streaming integration for Streamix.
This package connects Streamix pipelines to Server-Sent Events (SSE), WebSocket streaming, and HTTP response streaming with backpressure-aware and cancellation-friendly behavior.
Quick Start
Server-Sent Events (SSE)
using Streamix.AspNetCore;
[ApiController]
[Route("api")]
public class PricesController : ControllerBase
{
private readonly IPriceService priceService;
[HttpGet("prices")]
public IActionResult GetPrices()
{
var stream = priceService.GetPriceUpdates().Publish().RefCount();
return new StreamResult<decimal>(stream);
}
}
The StreamResult<T> handles:
- SSE headers and formatting
- Backpressure management (respects client slowness)
- Cancellation (closes cleanly when client disconnects)
- JSON serialization
Extension Methods
ToSseAsync(response, ct)- Stream items as Server-Sent EventsToWebSocketAsync(webSocket, ct)- Stream items to a WebSocketToWebSocketAsync(webSocket, serializer, ct)- Stream with custom serializationToJsonResponseAsync(response, ct)- Collect stream and write as JSON array
Features
✅ Backpressure-aware - Respects client-side flow control
✅ Cancellation support - Cleans up gracefully on disconnect
✅ Hot stream compatible - Works with .Publish().RefCount()
✅ Zero boilerplate - One-line integration in controllers
✅ Custom serialization - Override JSON serialization when needed
✅ Multiple formats - SSE, WebSocket, JSON arrays
More Shapes
StreamResult<T> gives you an IActionResult wrapper for SSE endpoints, and the package also supports minimal APIs, direct WebSocket streaming, and JSON response streaming.
When to Use
- Real-time updates (prices, notifications, metrics) → SSE or WebSocket
- Large result sets (reports, exports) → Streaming JSON
- Server-sent events (live feeds) →
ToSseAsync - Bi-directional communication → WebSocket
Learn More
- Overview and package map: README.md
- Developer guide: GETTING-STARTED.md
- Architecture and design notes: ARCHITECTURE.md
- Repository: github.com/khurram-uworx/streamix
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Streamix (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.