Skip to content

feat: PulseStreamHub and MapStreamQueryHub() for SignalR-based stream queries (Low Priority) #298

@samtrion

Description

@samtrion

User Story

As a developer building a real-time UI, I want to subscribe to IMediator.StreamQueryAsync results via a SignalR hub, so that I can push live data to browser clients without polling.


Background

⚠️ Low priority — implement only after all Tier 1–5 items are complete.


Requirements

  • Create src/NetEvolve.Pulse.AspNetCore/Hubs/PulseStreamHub.cs:
    • Hub subclass with StreamAsync<TQuery, TResponse>(TQuery query).
    • Iterates IMediator.StreamQueryAsync<TQuery, TResponse>(query, cancellationToken) and sends each item via Clients.Caller.SendAsync("OnItem", item).
    • Respects client-side cancellation.
  • Add MapStreamQueryHub<TQuery, TResponse>(this IEndpointRouteBuilder, string path) extension method.
  • Unit tests for hub and extension method.

Acceptance Criteria

  • Hub iterates the stream and sends all items to the caller.
  • Client cancellation stops the stream without exceptions.
  • MapStreamQueryHub() registers the hub at the specified path.
  • Unit tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureIndicates a new feature or enhancement to be added.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions