signal rity1
DESCRIPTION
TRANSCRIPT
![Page 1: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/1.jpg)
SignalRity
Yaniv RodenskiSenior Architect – Sela Group
Level: Intermediate - Advanced
![Page 2: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/2.jpg)
The way I used to get my data
![Page 3: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/3.jpg)
The way She is Getting her Data
![Page 4: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/4.jpg)
How do I get my data?
![Page 5: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/5.jpg)
Real-Time Web
![Page 6: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/6.jpg)
SignalRity
Yaniv RodenskiSenior Architect – Sela Group
Level: Intermediate - Advanced
![Page 7: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/7.jpg)
About me:
• Senior Architect - Sela Group• Windows Azure MVP• Coauthor of Developing Windows Azure
and Web Services (MOC 20487)
![Page 8: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/8.jpg)
Evolution of the real-time web
Polling
Long Polling
Forever-Frame
Server-sent Events
WebSockets
![Page 9: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/9.jpg)
Demo
Using WebSockets
![Page 10: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/10.jpg)
Why WebSockets are not Enough?
• HTML5 standard – great if you are living in 2020
• Low-level API• Strict prerequisites
![Page 11: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/11.jpg)
Introducing SignalR
• Rich API for real-time web applications• Supports WebSockets• Fallback to other mechanisms
![Page 12: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/12.jpg)
Hubs
• Hubs are high-level SignalR APIs• Provide a service-like abstraction• Provide a mechanism for invoking client
methods
![Page 13: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/13.jpg)
Demo
Hello Hubs
![Page 14: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/14.jpg)
Targeting Specific Clients
• When a client calls a hub, it gets a connection id
• You can use this connection id to send a message to this specific client
Clients.Client(connectionId).sendMessage(message)
![Page 15: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/15.jpg)
Groups
• Clients can be registered with a group• Part of the Hubs API
Groups.Add(Context.ConnectionId, groupName);
Clients.Group(groupName).invokeSomeClientMethod(args…);
![Page 16: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/16.jpg)
Demo
Clients and Groups
![Page 17: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/17.jpg)
Scaling out with SignalR
• One of the biggest issues with the “real-time web” is scaling out
• SignalR can span across multiple hosts using either Redis, SQL Server or Windows Azure Service Bus
![Page 18: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/18.jpg)
Demo
Scaling out with Windows Azure
![Page 19: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/19.jpg)
SignalR .NET Clients
• You can create SignalR clients in any .NET environment– .NET applications– Windows 8, Windows Phone 8 Apps– Even Silverlight– Xamarin
![Page 20: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/20.jpg)
Demo
A .NET Client
![Page 21: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/21.jpg)
Summary
• Real-time web does not need to be painful• SignalR can let you use the best available
option• SignalR is not just for web clients• SignalR scales
![Page 22: Signal rity1](https://reader033.vdocument.in/reader033/viewer/2022061220/54bad2ed4a795985478b456d/html5/thumbnails/22.jpg)
Resources
• http://signalr.net/• Twitter: @DamianEdwards, @davidfowl• http://sdrv.ms/152qU0b• @YRodenski