Streamix.AspNetCore 1.1.0

dotnet add package Streamix.AspNetCore --version 1.1.0
                    
NuGet\Install-Package Streamix.AspNetCore -Version 1.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="Streamix.AspNetCore" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Streamix.AspNetCore" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Streamix.AspNetCore" />
                    
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 Streamix.AspNetCore --version 1.1.0
                    
#r "nuget: Streamix.AspNetCore, 1.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 Streamix.AspNetCore@1.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=Streamix.AspNetCore&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Streamix.AspNetCore&version=1.1.0
                    
Install as a Cake Tool

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 Events
  • ToWebSocketAsync(webSocket, ct) - Stream items to a WebSocket
  • ToWebSocketAsync(webSocket, serializer, ct) - Stream with custom serialization
  • ToJsonResponseAsync(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

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 99 4/23/2026
1.0.0 112 4/20/2026