示例#1
0
        internal override Task <ServiceHubContext <T> > CreateHubContextAsync <T>(string hubName, CancellationToken cancellation)
        {
            var builder = new ServiceHubContextBuilder(_services);

            builder.ConfigureServices(services => services.Configure <ServiceManagerOptions>(o => o.ConnectionCount = 3));
            return(builder.CreateAsync <T>(hubName, cancellation));
        }
示例#2
0
        public async Task <IServiceHubContext> CreateHubContextAsync(string hubName, ILoggerFactory loggerFactory, CancellationToken cancellationToken)
        {
            var builder = new ServiceHubContextBuilder(_services);

            if (loggerFactory != null)
            {
                builder.ConfigureServices(services => services.AddSingleton(loggerFactory));
            }
            var serviceHubContext = await builder.CreateAsync(hubName, cancellationToken);

            return(serviceHubContext);
        }