Intent.AspNetCore.SignalR module enables real-time, bidirectional communication between server and clients using ASP.NET Core SignalR. Perfect for features like live notifications, chat, dashboards, and collaborative editing.
Overview
SignalR automatically manages connections and enables your server to push content to connected clients instantly. It abstracts away the complexities of WebSockets, Server-Sent Events, and Long Polling, automatically choosing the best transport method.What Gets Generated
Hub Classes
SignalR hubs handle client-server communication:Hub Service
Services that send messages to clients:SignalRConfiguration
Configures SignalR services:Key Features
Real-Time Updates
Push updates to clients instantly
Automatic Transport
Automatically chooses best transport method
Groups
Send messages to specific groups of clients
Scaling
Scale across multiple servers with backplane
Creating Hubs
Basic Hub
Hub with Authorization
Hub with Dependency Injection
Client Targets
Send to All Clients
Send to Specific Client
Send to All Except Caller
Send to Specific User
Send to Group
Send to Multiple Clients
Groups
Adding to Groups
Automatic Group Management
Using Hub Services
Call hub services from your application logic:Client Integration
JavaScript/TypeScript
C# Client
Authentication
JWT Bearer Authentication
Scaling with Azure SignalR Service
For production scaling:Redis Backplane
Scale across multiple servers:Best Practices
Connection Management
Connection Management
- Implement automatic reconnection
- Handle connection lifecycle events
- Clean up resources on disconnect
- Monitor connection status
Performance
Performance
- Keep messages small
- Use binary protocols for large data
- Implement backpressure handling
- Monitor connection count
Security
Security
- Always use authentication for sensitive data
- Validate all client inputs
- Implement authorization for hub methods
- Use HTTPS in production
Error Handling
Error Handling
- Handle hub method exceptions
- Implement client-side error handling
- Log connection failures
- Provide meaningful error messages
Common Use Cases
Real-Time Notifications
Live Dashboard Updates
Chat Application
Progress Updates
Installation
Dependencies
Intent.Common.CSharpIntent.Modelers.ServicesIntent.OutputManager.RoslynWeaver
Next Steps
Controllers
Integrate SignalR with REST APIs
Security
Secure SignalR connections
ASP.NET Core
Learn about the core infrastructure
