Esempio n. 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));
        }
Esempio n. 2
0
        public async Task <IServiceHubContext> CreateHubContextAsync(string hubName, ILoggerFactory loggerFactory = null, CancellationToken cancellationToken = default)
        {
            var builder = new ServiceHubContextBuilder(new ServiceCollection().Add(_services));

            if (loggerFactory != null)
            {
                builder.WithLoggerFactory(loggerFactory);
            }
            var serviceHubContext = await builder.CreateAsync(hubName, cancellationToken);

            return(serviceHubContext);
        }
Esempio n. 3
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);
        }