This is fairly boilerplate, it might look a little odd compared to the standard SignalR setup, but this is because you can't guarantee you are the first to ask for the hub something else might have called it before you) -
Creating this class will make it appear in the Umbraco generated code at /umbraco/backoffice/signalr/hubs which is how you can then refrence it in code
depends a lot on the setup but - I would suspect you have something in the background (so server-side c#) looking for changes, and pushing that to your SignalR Clients when a change happens, they would then receive the message and act upon it.
Umbraco SignalR tutorial
Is there a tutorial how to use / install signalr with umbraco
i found this topic, but it is very old and the link is no longer working
No one knows? :\
Hi Lasse,
i don't have a tutorial, but i do have a couple of projects using signalR
uSync8- - uses signalR
from a client side,
you need to create a Hub https://github.com/KevinJump/uSync8/blob/master/uSync8.BackOffice/App_Plugins/uSync8/uSyncHub.js
This is fairly boilerplate, it might look a little odd compared to the standard SignalR setup, but this is because you can't guarantee you are the first to ask for the hub something else might have called it before you) -
The only element that changes is the name of your signlarR hub. https://github.com/KevinJump/uSync8/blob/master/uSync8.BackOffice/App_Plugins/uSync8/uSyncHub.js#L47
then in the angular controller(s) where you want to use SignalR you need to initialise the hub so you can see this at the end of the main uSync controller here : https://github.com/KevinJump/uSync8/blob/master/uSync8.BackOffice/App_Plugins/uSync8/settings/uSyncController.js#L199
from the back end code you need to create a hub
https://github.com/KevinJump/uSync8/blob/master/uSync8.BackOffice/Hubs/uSyncHub.cs
Creating this class will make it appear in the Umbraco generated code at
/umbraco/backoffice/signalr/hubs
which is how you can then refrence it in codeHooking into SignalR can be done a number of ways, in the uSync example we use a simple wrapper class to send messages to the clients https://github.com/KevinJump/uSync8/blob/master/uSync8.BackOffice/Hubs/HubClientService.cs - and we call this from API controllers, etc as needed.
hope this gives you some pointers.
Thanks for the reply, i finally got the basic chat program working (Y)
how would you use signalr to check if data has changed. I don't have db connection but a json string giving me all data i need.
Hi
depends a lot on the setup but - I would suspect you have something in the background (so server-side c#) looking for changes, and pushing that to your SignalR Clients when a change happens, they would then receive the message and act upon it.
I'm trying to make a chatroom myself, have you got an example of how you managed to achieve it?
is working on a reply...