signalr - building an async web app with .net

13
SIGNALR Building an async web app with .NET Oslo/NNUG Tomas Jansson 29/01/13

Upload: tomas-jansson

Post on 16-Jun-2015

1.325 views

Category:

Technology


0 download

DESCRIPTION

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.

TRANSCRIPT

SIGNALR

Building 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

Summary

Resources

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

SCALE OUT

Server 1 Server 2

Client 1

Client 2

Client 3

Client 4

Client 5

Client 6

pub/sub

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)

Questions?