Question

I've just started using SignalR and an Azure ServiceBus backplane. This works correctly, with messages sent to one instance ending up on the service bus and propagating to all the other SignalR instances.

I have a situation where I'd like to manually add a message to the backplane, i.e. it's not generated by a SignalR client. This message is generated by a scheduled task and I'd like to push it out to all clients and therefore all instances. The scheduled task already has access to the service bus and the SignalR libraries (if needed).

While I could re-create the functionality myself using a different topic and subscription,it would be a lot less work if I could just the existing backplane logic.

Is this possible?

Was it helpful?

Solution

Sure, just use this API to send to clients from outside the hub http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#callfromoutsidehub

OTHER TIPS

You can do this via sending to a hubs clients outside of a hub.... AKA:

GlobalHost.ConnectionManager.GetHubContext<MyHubClass>().Clients.All.foo();

You can learn more via http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#callfromoutsidehub

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top