Giter VIP home page Giter VIP logo

orleansr-old's Introduction

OrleansR

A SignalR backplane implemented in Orleans

Motivation

When running SignalR on more than one web server (a common scenario in the cloud) you need a backplane to connect together each of the servers. This allows messages broadcast from a user connected to one server, to reach the users on the other servers.

There are already some backplane options in Azure:

  • SQL Server
  • Service Bus Topics/Subscriptions
  • Redis (you should probably use this)

I thought it would be interesting to implement a backplane in Orleans.

Project Structure

The projects required to implement a system:

  • OrleansR.GrainInterfaces The Oreans grain interfaces.
  • OrleansR.Grains The Orleans grain implementations.
  • OrleansR.MessageBus The IMessageBus implementation which plugs into SignalR, and connects to the Orleans Silos.

Sample/test projects included in the solution:

  • OrleansR.Cloud A sample project to deploy the solution to Azure.
  • OrleansR.UnitTests Unit tests for the grains.
  • OrleansR.Web A sample web application.
  • OrleansR.WorkerRoleSiloHost A sample Worker Role to host the Orleans Silo.

Usage

Configure Orleans in the usual way, by starting up a Silo, and connecting a web application to it as described here.

When configuring SignalR in the Startup class of your web application, register the OrleanMessageBus class like this:

using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Messaging;
using OrleansR.MessageBus;
using Owin;

namespace OrleansR.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
 			// configure the OrleansR message bus
            var config = new ScaleoutConfiguration { MaxQueueLength = 10, QueueBehavior = QueuingBehavior.Always };
            var omb = new OrleansMessageBus(GlobalHost.DependencyResolver, config);
            GlobalHost.DependencyResolver.Register(typeof(IMessageBus), () => omb);

            // register SignalR as ususal
            app.MapSignalR();
        }
    }
}

License

MIT

orleansr-old's People

Contributors

richorama avatar

Stargazers

Mladen Mihajlović avatar blik137 avatar  avatar Richard Chmielek avatar PJ Legendre avatar  avatar EM avatar  avatar Nguyen Khac Trieu avatar John avatar valery sntx avatar 疯风愚雨 avatar  avatar Sander Soots avatar send2vinnie avatar Guilhem Vellut avatar  avatar Beau Button avatar James Jones avatar Brad Jones avatar Kasper Frank avatar Jean-Sébastien Tremblay avatar Rocky LIU avatar James Andrew-Smith avatar  avatar

Watchers

Brad Jones avatar Alex McCool avatar send2vinnie avatar  avatar Rik avatar Osvaldo avatar James Cloos avatar Dmytro Dziuma avatar Ivan Ignatiev avatar Anton Moldovan avatar  avatar Roger Creyke avatar Gutemberg Ribeiro avatar  avatar Ashkan Saeedi Mazdeh avatar Phil Bernstein avatar Benjamin Wanner avatar James Jones avatar Zhou, Xiaojun avatar Armon Avrahamy avatar  avatar

orleansr-old's Issues

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

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.