SignalR beim ShareCamp 2013

Post on 09-May-2015

540 views 0 download

Transcript of SignalR beim ShareCamp 2013

christian.heindel@communardo.de

Christian Heindel @c_heindel

Bild durch Klicken auf Symbol hinzufügen

Asynchrone Echtzeitanwendungen in SharePoint mitSignalR und knockout.JS

SignalR

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

SignalR ist ein Projekt von• David Fowler

(Senior Software Design Engineer, ASP.NET Team) • Damien Edwards

(Senior Program Manager, Microsoft)

GitHub, Nuget Gallery, SignalR 0.5

ShareCamp 2012Christian Heindel:Push-Benachrichtigungen in SharePoint via SignalR

Vor einem Jahr…

2

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Bild durch Klicken auf Symbol hinzufügenhttp://de.slideshare.net/c.heindel/pushbenachrichtigungen-in-sharepoint-via-signalr

Folien ShareCamp 2012

3

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

• SignalR offiziell zu ASP.NET aufgenommen• Größeres Team bei Microsoft (z.B. Patrick Fletcher)• Professionelle Software- und Lasttests ;-)• fast 50.000 Downloads via nuget• Zusätzliche Open Source-Bibliotheken und Projekte

entstehen, z.B. SignalR-ObjC @ GitHub (für iOS and Mac)

• Jabbr.net (mächtig!)• IE10 (Yippie!)

Mittlerweile…

4

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

• Mai 2012: DEMO: Max Melcher (Download-Tracking)• November 2012: DEMO: Realtime

ASP.NET Web API tracing with SignalR• Dezember 2012: Max Melcher schwitzt und flucht:

http://melcher.it/2012/12/signalr-in-sharepoint-2013-the-real-time-web-is-coming/

• Dezember 2012: SignalR on Mono rücken näher zusammen (Link)

• Februar 2013: Channel 9 veröffentlicht VideoBuilding Web Apps with ASP.NET Jump Start: (08) Real-time Communication with SignalR (Link, 53m)

• Februar 2013: Publish the SignalR Getting Started Sample as a Windows Azure Web Site

Mittlerweile…

5

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

• März 2013: Ergänzung zur Download DEMO, ein Upload-Beispiel (BEKK)

• März 2013: Christian Weyer: 3h 28m, Intermediate Introducing ASP.NET SignalR - Push Services with Hubs (Link)

• März 2013: MSDN Dokumentation verfügbar• März 2013: Shopping Cart Beispiel• Seit 2 Tagen:

12.04.13: SignalR 1.1.0beta(mit ScaleOut Providern für Redis, SqlServer and Azure Service Bus)

• ShareCamp 2013…

Mittlerweile…

6

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Was ist SignalR?

7

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Bild durch Klicken auf Symbol hinzufügen• WebSockets• Server Sent Events• Forever Frame• Ajax long polling

(Dokumentation)

Transportwege und Fallbacks

8

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

http://www.asp.net/signalr/overview/introduction/connections-and-hubs

- simple endpoint for sending single-recipient, grouped, or broadcast messages

- Connection API (represented in .NET code by the PersistentConnection class)

- direct access to the low-level communication network that SignalR exposes

- familiar to developers who have used connection-based APIs such as Windows Communication Foundation.

Modell 1: Connection

9

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

- high-level pipeline built upon the Connection API - allows client and server to call methods on each other

directly- SignalR handles dispatching across machine boundaries

as if by magic- For different types of messages, it is recommended that

you use the Hub class, so that you won't have to create your own dispatching

- using the Hub, you can call methods on the clients, rather than sending an explicit message that needs to be received, interpreted, and acted upon

- familiar to developers who have used remote invocation APIs such as .NET Remoting.

Modell 2: Hub

10

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Auf Facebook würde man schreiben: “Es ist kompliziert”

Auszug aus der Dokumentation:

Server: 2012*, 2008 r2, Azure Website, Windows 8*, Windows 7.NET Framework: 4.0 / 4.5*IIS: 7,7.5,8*, 8 Express*Browser: IE10*Silverlight: N/A (restr. 5+)WP8: IE* (restr. WP8 App)

Nur * unterstützt auch Websockets

Systemanforderungen

11

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

• Standardlimit im IIS: 5.000 Verbindungen pro CPU• Für SignalR gehen z.B. auch 20.000 Verbindungen• Spezielle Protokolle erfordern spezielles

Lasttestwerkzeughttps://github.com/SignalR/SignalR/tree/dev/src/Microsoft.AspNet.SignalR.Crank

Lastgrenzen / Lasttest

12

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

The source code for ASP.NET SignalR is available under an open source license.Developers outside of Microsoft may submit patches and code contributions that the Microsoft development team will review for potential inclusion.The framework continues to be fully support and staffed by Microsoft.

Open Source

13

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Bild durch Klicken auf Symbol hinzufügenhttp://forums.asp.net/1254.aspx

Forum

14

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

SharePoint 2010• SharePoint verwendet .NET Framework 3.5• SignalR benötigt .NET Framework 4.0 / 4.5• Proxy notwendig (WCF, HttpHandler o.ä.)

SharePoint 2013• .NET Framework 4.0

Aber: • Normalerweise hängt sich SignalR an „App_Start“ Event und

registriert die Route „~/signalr/hubs“ (Clients finden damit immer den Hub)

• In SharePoint gibt es aber kein „App_Start“! ¯\_(ツ )_/¯Global.asax kann man nicht automatisch deploybar anpassen Lösung: HttpModule (Link)

SharePoint macht mal wieder nur Probleme…

15

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

• HttpModule• SPWebConfigModificationHandler• VirtualPathProvider

<SanftenDruckErhoehen>Nette Verpackung als Open Source Lösung von Max Melcher geplant… ;-)</SanftenDruckErhoehen>

Derzeitige Lösung für SharePoint 2013

16

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Bild durch Klicken auf Symbol hinzufügen

17

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Socket.IO (Framwork für node.js)

NowJS (ein node.js Modul)

Alternative

18

Seite© Communardo Software GmbH · Kleiststraße 10 a · D-01129 Dresden/Germany · Fon +49 (351) 833 82-0 · Mail info@communardo.de · www.communardo.de

Communardo Software GmbHKleiststraße 10 a01129 Dresdenhttp://www.communardo.deinfo@communardo.de

Telefon: +49 (351) 833 820 Standort Stuttgart

Leinfelder Straße 6470771 Leinfelden-Echterdingen

Telefon: +49 (711) 722 497 09

Kontakt

19

Christian Heindel

christian.heindel@communardo.de www.communardo.de

Telefon: +49 (351) 833 82-234