예제 #1
0
 public RedisSignalBus(string host, int port, string password)
 {
     Host = host;
     Port = port;
     Password = password;
     Subscriptions = new ConcurrentDictionary<string, bool>();
     _inProcessSignalBus = new InProcessSignalBus();
     ConnectionReady();
 }
예제 #2
0
            internal DefaultDependencyResolver()
            {
                var store = new Lazy <InProcessMessageStore>(() => new InProcessMessageStore());

                Register(typeof(IMessageStore), () => store.Value);

                var serializer = new JsonConvertAdapter();

                Register(typeof(IJsonSerializer), () => serializer);

                Register(typeof(IActionResolver), () => new DefaultActionResolver());
                Register(typeof(IHubActivator), () => new DefaultHubActivator());
                Register(typeof(IHubFactory), () => new DefaultHubFactory());

                var hubLocator = new DefaultHubLocator();

                Register(typeof(IHubLocator), () => hubLocator);

                var hubTypeResolver = new Lazy <DefaultHubTypeResolver>(() => new DefaultHubTypeResolver());

                Register(typeof(IHubTypeResolver), () => hubTypeResolver.Value);

                var signalBus = new InProcessSignalBus();

                Register(typeof(ISignalBus), () => signalBus);

                var pesistentConnectionFactory = new DefaultPersistentConnectionFactory();

                Register(typeof(IPersistentConnectionFactory), () => pesistentConnectionFactory);

                var minifier = new NullJavaScriptMinifier();

                var proxyGenerator = new DefaultJavaScriptProxyGenerator(hubLocator, (IJavaScriptMinifier)GetService(typeof(IJavaScriptMinifier)) ?? minifier);

                Register(typeof(IJavaScriptProxyGenerator), () => proxyGenerator);

                var connectionIdFactory = new GuidConnectionIdFactory();

                Register(typeof(IConnectionIdFactory), () => connectionIdFactory);

                Register(typeof(ITransportManager), () => TransportManager.Default);

                var signaler = new Lazy <Signaler>(() => new Signaler(DependencyResolver.Resolve <ISignalBus>()));

                Register(typeof(Signaler), () => signaler.Value);
            }
            internal DefaultDependencyResolver()
            {
                var store = new Lazy <InProcessMessageStore>(() => new InProcessMessageStore());

                Register(typeof(IMessageStore), () => store.Value);

                var serialzier = new JavaScriptSerializerAdapter(new JavaScriptSerializer
                {
                    MaxJsonLength = 30 * 1024 * 1024
                });

                Register(typeof(IJsonStringifier), () => serialzier);

                Register(typeof(IActionResolver), () => new DefaultActionResolver());
                Register(typeof(IHubActivator), () => new DefaultHubActivator());
                Register(typeof(IHubFactory), () => new DefaultHubFactory());

                var hubLocator = new DefaultHubLocator();

                Register(typeof(IHubLocator), () => hubLocator);

                var signalBus = new InProcessSignalBus();

                Register(typeof(ISignalBus), () => signalBus);

                var pesistentConnectionFactory = new DefaultPersistentConnectionFactory();

                Register(typeof(IPersistentConnectionFactory), () => pesistentConnectionFactory);

                var minifier = new NullJavaScriptMinifier();

                var proxyGenerator = new DefaultJavaScriptProxyGenerator(hubLocator, (IJavaScriptMinifier)GetService(typeof(IJavaScriptMinifier)) ?? minifier);

                Register(typeof(IJavaScriptProxyGenerator), () => proxyGenerator);

                var clientIdFactory = new GuidClientIdFactory();

                Register(typeof(IClientIdFactory), () => clientIdFactory);
            }