SignalR Implementation

Topics: General, Writing modules
Feb 21, 2012 at 1:37 PM
Edited Feb 21, 2012 at 1:38 PM

Hey guys,

Was really just wondering if anyone had implemented SignalR into Orchard. I had a brief look and I failed quite miserably. This is SignalR if you hadn't heard of it before: http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx

Long links <3 

So anyway, I suspect all of Orchards application start up stuff is sort of screwing up SignalR's ability to set up its hubs and the proxy script generator. I asked a question on Stack Overflow, but didn't get much back: http://stackoverflow.com/questions/9079016/signalr-chat-module-in-orchard-cms

Would be great to know if anyone has succeeded in getting SignalR to work in Orchard, and if so, how =D Maybe I am just being block headed and it is horribly obvious, I hope so at least. I have some sexy code using SignalR that I was hoping to splash across orchard. 

 

Cheers

Feb 21, 2012 at 8:10 PM

I think this is something similar (but non-free): http://pokein.com/

I messed with it once in combination with Orchard and could get it to work.

Take note that their 'free' version only works on 'localhost' (this fact is hidden in their changelog: FREE editions won't be answering non-Local requests)

Feb 23, 2012 at 4:39 PM

We fought and fought with SignalR combined with orchard for a long while and finally gave up.  Basically there were a handful of issues, some with orchard and some with SignalR.  The main dealbreakers were that a) SignalR had to be referenced in the main orchard web project, as it registers itself using the dynamic module registration stuff, and b) some of the request lifecycle management in orchard really didn't play well with SignalR. I eventually got it working somewhat and even got some of the dependency injection stuff working, but in the end we ran into so many issues that we decided to host it in a separate application.  This opened up a whole new can of worms...

1) SignalR doesn't support cross domain communication, a la JSONP, so it has to be hosted on the same domain.  The next attempt was to use it in a virtual directory, however we ran into issues with orchard configuration sections being inherited and causing problems.  In the end, we ended up setting up a completely separate web site on the server and utilizing a reverse proxy to pipe traffic to the separate site.  We could not get the hubs working with this configuration, and are currently using the lower level persistent connection.

Feb 25, 2012 at 3:32 PM

Yeah, I had sort of come to the same conclusion about integrating it within Orchard. But thanks for the heads about work arounds, they look quite horrible to implement ^^. Think I will just give up and cry. 

It really is a shame though. SignalR has so much potential to make slick modules within Orchard. Maybe SignalR/Orchard team will band together and work out a fix because these are both fairly new powerful systems that people are starting to use more and more. 

Ah well, good to hear you got to a sort of solution in the end. Thanks for the time, and good luck with further Orchard endeavours.

Coordinator
Feb 26, 2012 at 5:45 AM

You should tell that to David Fowler or Damian Edwards then ;) I sent them e-mail about this thread.