private static async Task ReportServiceStartedAsync(
            OperationContext context,
            StartupShutdownSlimBase server,
            IDistributedCacheServiceHost host)
        {
            LifetimeTracker.ServiceStarted(context);
            host.OnStartedService();

            if (host is IDistributedCacheServiceHostInternal hostInternal &&
                server is IServicesProvider sp &&
                sp.TryGetService <ICacheServerServices>(out var services))
            {
                await hostInternal.OnStartedServiceAsync(context, services);
            }
        }
Beispiel #2
0
        private static async Task ReportServiceStartedAsync(
            OperationContext context,
            StartupShutdownSlimBase server,
            IDistributedCacheServiceHost host,
            DistributedContentSettings distributedContentSettings)
        {
            LifetimeTracker.ServiceStarted(context);
            host.OnStartedService();

            if (
                // Don't need to call the following callback for out-of-proc cache
                distributedContentSettings.OutOfProcCacheSettings is null &&
                host is IDistributedCacheServiceHostInternal hostInternal &&
                server is IServicesProvider sp &&
                sp.TryGetService <ICacheServerServices>(out var services))
            {
                await hostInternal.OnStartedServiceAsync(context, services);
            }
        }