protected Worker()
        {
            SubscriptionBus = DependencyResolver.Get<ISubscriptionBus>();
            PublishingBus = DependencyResolver.Get<IPublishingBus>();
            RequestBus = DependencyResolver.Get<IRequestBus>();
            ResponseBus = DependencyResolver.Get<IResponseBus>();
            SendingBus = DependencyResolver.Get<ISendingBus>();
            ReceivingBus = DependencyResolver.Get<IReceivingBus>();

            WorkerId = WorkerId.New();
            ExecutingJob = null;
            CompletionCallback = null;
        }
        public ComputationalUnitSupervisor(Bootstrapper bootstrapper, ISubscriptionBus subscriptionBus, IPublishingBus publishingBus,
            IReceivingBus receivingBus)
        {
            Debug.Assert(IntervalForCheckingIfDispatcherIsOnline < MaxTimeDispatcherCanBeSilent, "IntervalForCheckingIfDispatcherIsOnline < MaxTimeDispatcherCanBeSilent");

            AttachedDispatchers = new List<DispatcherId>();
            OfflineDispatchers = new List<DispatcherId>();
            Bootstrapper = bootstrapper;
            SubscriptionBus = subscriptionBus;
            PublishingBus = publishingBus;
            ReceivingBus = receivingBus;

            IsComputationalUnitRestorationEnabled = true;
        }
 public StepsContext()
 {
     DependencyResolver.Reset();
     DependencyResolver.Initialize();
     DispatcherLifeSpan = new DispatcherLifeSpan
     {
         Mode = DispatcherLifeSpanMode.UntilTimedOut,
         Timeout = TimeSpan.FromSeconds(10)
     };
     BootstrapSettings = new BootstrapSettings();
     SendingBus = DependencyResolver.Get<ISendingBus>();
     ReceivingBus = DependencyResolver.Get<IReceivingBus>();
     Bootstrapper = DependencyResolver.Get<Bootstrapper>();
     LatestLifeSignals = new Dictionary<string, LifeSignal>();
     MaxTimeDispatcherCanBeSilent = TimeSpan.FromSeconds(5);
     ClearAmqpResources();
 }