public static IDependencyResolver UseDede(this IDependencyResolver resolver, SignalRScaleoutConfiguration configuration)
        {
            var bus = new Lazy <SignalRMessageBus>(() => new SignalRMessageBus(resolver, configuration));

            resolver.Register(typeof(IMessageBus), () => bus.Value);

            return(resolver);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SignalRMessageBus"/> class.
 /// </summary>
 /// <param name="resolver">The resolver.</param>
 /// <param name="config">The configuration.</param>
 public SignalRMessageBus(IDependencyResolver resolver, SignalRScaleoutConfiguration config)
     : base(resolver, config)
 {
     this.m_hub        = new HubConnection(config.RemoteUrl);
     this.m_hub.Error += this.m_hub_Error;
     this.m_proxy      = this.m_hub.CreateHubProxy("backplaneHub");
     this.m_proxy.On <int, long, byte[]>("send", this.Received);
     this.m_hub.Start().Wait();
     base.Open(0);
 }
        public static IDependencyResolver UseDede(this IDependencyResolver resolver, string url)
        {
            SignalRScaleoutConfiguration config = new SignalRScaleoutConfiguration(url);

            return(UseDede(resolver, config));
        }