richorama / OrleansR-old

A SignalR backplane implemented in Orleans
25 stars 5 forks source link

How to insert events directly into the Orleans backplane and possible caveats in the implementation #2

Open veikkoeeva opened 9 years ago

veikkoeeva commented 9 years ago

Hi!

I just saw this and briefly tried the implementation. However, I became to think that as the grains are running in the Orleans silos, has anyone tried inserting messages directly into the backplane? It looks like taking GlobalHost.ConnectionManager.GetHubContext<TestHub>() in some grain in the Orleans cluster won't cut it when one tries to send events to the backplane, the events do not seem to propagate to the bus. I'm not sure if I'm doing it right, but perhaps it would be smarter to get a hold on one -- the one -- of the IPubSubGrains and insert messages through them.

Then also, has anyone any thoughts about the potential issues and remedies with this current implementation? It looks like if there could be only one IPubSubGrain and I'm not sure I understand the reasoning behind OrleansMessageBus in general (for one, about the observers).

Would it make sense in OrleansMessageBus to create more IPubSubGrains perhaps one in each silo, and then SignalR would "shard" the messages to different silos with the streamIndex?

richorama commented 9 years ago

Hi Veikko,

I'm away at the moment, and I can't remember the detail of the implementation. I'll get back to you in a day of two when I get back...

Thanks!

-----Original Message----- From: "Veikko Eeva" notifications@github.com Sent: ‎26/‎01/‎2015 21:22 To: "OrleansContrib/OrleansR" OrleansR@noreply.github.com Subject: [OrleansR] How to insert events directly into the Orleans backplaneand possible caveats in the implementation (#2)

Hi! I just saw this and briefly tried the implementation. However, I became to think that as the grains are running in the Orleans silos, has anyone tried inserting messages directly into the backplane? It looks like taking GlobalHost.ConnectionManager.GetHubContext() in some grain in the Orleans cluster won't cut it when one tries to send events to the backplane, the events do not seem to propagate to the bus. I'm not sure if I'm doing it right, but perhaps it would be smarter to get a hold on one -- the one -- of the IPubSubGrains and insert messages through them. Then also, has anyone any thoughts about the potential issues and remedies with this current implementation? It looks like if there could be only one IPubSubGrain and I'm not sure I understand the reasoning behind OrleansMessageBus in general (for one, about the observers). Would it make sense in OrleansMessageBus to create more IPubSubGrains perhaps one in each silo, and then SignalR would "shard" the messages to different silos with the streamIndex? — Reply to this email directly or view it on GitHub.=

veikkoeeva commented 9 years ago

Ah, thanks. Perhaps one wouldn't need the backplane if it weren't to signaling to other clients in the SignalR groups -- or perhaps that too can be done easily without a SignalR backplane (I haven't really thought about this).

I was learning a bit more about SignalR and read the Stockticker example and thought that instead of the mentioned StockTicker class, one registers an observer (XyzFactory.CreateObjectReference) in hub and listens to the grains. It feels like the messages would be propagated without a SignalR bus doing like this. One thing missing would be propagating messages between groups the "SignalR way".

In any event, I added also a PR #3 with updated Nuget packages. There were some complications at least on my environment (explained in the PR message).

veikkoeeva commented 9 years ago

I closed this accidentally.

richorama commented 9 years ago

Just so I understand the issue, what problem are you trying to solve?

This project connects together servers running signalr, such that users connected to different servers can pass messages between each other.

If you're running a single server, there is no need to use this project.

veikkoeeva commented 9 years ago

How to insert message from inside Orleans silo grains to the SignalR message backplane so that they would be propagated to the clients. I couldn't get it to work.

The rest is just that I'm wondering the limitations of the current approach and the overlap between Orleans and SignalR in general and could SignalR just manage the outbound connections and the rest would be handled inside Orleans. It would mean SignalR calls such as ``Clients.All.xyz" wouldn't work, but perhaps that wouldn't be such a great loss. Then if there were multiple front-end www servers, the hubs therein would just register upon startup to listen to some grains.