Example #1
0
 internal void SetParent(HostedServiceWrapper parent)
 {
     foreach (var hostedService in _hostedServices)
     {
         hostedService.Parent = parent;
     }
 }
Example #2
0
        internal HostedServiceWrapper Build(IServiceProvider sp)
        {
            var hostedServices = _activators
                                 .Select(a => a(sp))
                                 .ToArray();
            var sequentialHostedServices = new SequentialHostedServices(hostedServices);
            var logger = sp.GetRequiredService <ILogger <HostedServiceWrapper> >();

            var wrapper = new HostedServiceWrapper(sequentialHostedServices, logger)
            {
                Name = _name
            };

            sequentialHostedServices.SetParent(wrapper);

            return(wrapper);
        }