WHAT IS ASYNC WEB?
Server
Client1
Client2
Client3
When clients do not have
persistent connections
1.
2.2.
3. 3.
WHAT IS ASYNC WEB?
Server
Client1
Client2
Client3
When clients have persistent
connections against the server
1.
2.2.
WHY ASYNC WEB?
Richer clients
Diagnostic
Chat
Collaboration
Real-time analysis
Notifications
”Anything real-time”
”Anything collaborative”
WHAT IS SIGNALR?
Abstraction over persistent connections
Asynchronous scalable web applications
It’s like Socket.IO and nowjs (nodejs)
for .NET
HOW?
1. Install-package Microsoft.AspNet.SignalR -pre (-pre when pre-release)
2. Server
3. Client
[HubName("simple")]public class SimpleHub : Hub{ public void CallOut(string message) { Clients.Others(message); }}
$(function() { var simpleHub = $.connection.simple; $.extend(simpleHub.client, { echo: function(message) { alert(message); } }); $("#some-button").click(function() { simpleHub.server.callOut("Echo"); });});
DEMO TIME!
1. Persistent connection
2. Chat
3. Chat with Redis
4. (Windows app client) – if there is time
SUMMARY
• Async web is coming for you
• Collaboration, real-time and notification systems
• SignalR is a simple to use persistent connection abstraction
for .NET
RESOURCE
• Demo projects: https://github.com/mastoj/SignalRPres
• SignalR project page: http://www.signalr.net
• SignalR on github: https://github.com/SignalR/SignalR (good
samples)
• Redis for windows: http://tinyurl.com/winredis (Microsoft Open
Tech)