SIGNALRBuilding an async web app with .NET            Oslo/NNUG           Tomas Jansson              29/01/13
Tomas JanssonManager/Faggruppeleder .NETBEKK Oslo@TomasJanssonhttp://blog.tomasjansson.com
AGENDA         What is async web?         Why async web?         What is SignalR?         How?         Demo         Summar...
WHAT IS ASYNC WEB?When clients do not havepersistent connections              Client1                                     ...
WHAT IS ASYNC WEB?When clients have persistentconnections against the server Client1                                   1. ...
WHY ASYNC WEB?Richer clientsDiagnosticChatCollaborationReal-time analysisNotifications”Anything real-time””Anything collab...
WHAT IS SIGNALR?Abstraction over persistent connectionsAsynchronous scalable web applicationsIt’s like Socket.IO and nowjs...
HOW?1.   Install-package Microsoft.AspNet.SignalR -pre (-pre when pre-release)2.   Server              [HubName("simple")]...
DEMO TIME!1. Persistent connection2. Chat3. Chat with Redis4. (Windows app client) – if there is time
SCALE OUT                                   pub/sub           Server 1                                     Server 2Client ...
SUMMARY• Async web is coming for you• Collaboration, real-time and notification systems• SignalR is a simple to use persis...
RESOURCE• Demo projects: https://github.com/mastoj/SignalRPres• SignalR project page: http://www.signalr.net• SignalR on g...
Questions?
Upcoming SlideShare
Loading in …5
×

SignalR - Building an async web app with .NET

1,719 views

Published on

The presentation is a really short introduction. To get the most of it you should go to: https://github.com/mastoj/SignalRPres where I have some really small sample projects. If you have installed redis, follow the instructions here https://github.com/MSOpenTech/Redis, and uses IIS express you can try running scale out with the MyFarm.ps1 script in this folder: https://github.com/mastoj/SignalRPres/tree/master/Chatty/Chatty.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,719
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
11
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Hej, jag heter Tomas
  • I en synkron miljø så tar hvert enkelt request en thread  mange request  lavere ytelse
  • Nå er vi ikke avhengig av noen polling tid hvis vi har en «true» persistent connection.Modellen er asyn, så hver connection trenger ikke en egen thread.
  • Vi trenger abstraktionen då web socket ikke er 100% støttet og å programmere mot socket er vanskeligDet er en abstraktion over en persistent connectionWebSockets --> server sent events --> forever frame --> long pollingWebSockets  persistent tcp connectionServer sent events /eventsource  one way messaging / client listens to eventsForever frame – En iframe etter sidlasting med en laaang connectionLong polling  poll and wait for dataSkallerer bra, lagrer ikke noe state på serveren. Har støtte for scale out gjenom redis og azure service bus som default.
  • ASP.NET Web API finns demos og forklaringerDemo project kommer med magisk branching graf
  • SignalR - Building an async web app with .NET

    1. 1. SIGNALRBuilding an async web app with .NET Oslo/NNUG Tomas Jansson 29/01/13
    2. 2. Tomas JanssonManager/Faggruppeleder .NETBEKK Oslo@TomasJanssonhttp://blog.tomasjansson.com
    3. 3. AGENDA What is async web? Why async web? What is SignalR? How? Demo Summary Resources
    4. 4. WHAT IS ASYNC WEB?When clients do not havepersistent connections Client1 1. Server 2. 2. 3. 3. Client3 Client2
    5. 5. WHAT IS ASYNC WEB?When clients have persistentconnections against the server Client1 1. Server 2. 2. Client3 Client2
    6. 6. WHY ASYNC WEB?Richer clientsDiagnosticChatCollaborationReal-time analysisNotifications”Anything real-time””Anything collaborative”
    7. 7. WHAT IS SIGNALR?Abstraction over persistent connectionsAsynchronous scalable web applicationsIt’s like Socket.IO and nowjs (nodejs) for .NET
    8. 8. HOW?1. Install-package Microsoft.AspNet.SignalR -pre (-pre when pre-release)2. Server [HubName("simple")] public class SimpleHub : Hub { public void CallOut(string message) { Clients.Others(message); } }3. Client $(function() { var simpleHub = $.connection.simple; $.extend(simpleHub.client, { echo: function(message) { alert(message); } }); $("#some-button").click(function() { simpleHub.server.callOut("Echo"); }); });
    9. 9. DEMO TIME!1. Persistent connection2. Chat3. Chat with Redis4. (Windows app client) – if there is time
    10. 10. SCALE OUT pub/sub Server 1 Server 2Client 1 Client 2 Client 3 Client 4 Client 5 Client 6
    11. 11. SUMMARY• Async web is coming for you• Collaboration, real-time and notification systems• SignalR is a simple to use persistent connection abstraction for .NET
    12. 12. 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)
    13. 13. Questions?

    ×