Exemple #1
0
        public AsynchronousDispatchSchedulerWireup(Wireup wireup, IDispatchCommits dispatcher, DispatcherSchedulerStartup startup)
            : base(wireup)
        {
            var option = Container.Resolve <TransactionScopeOption>();

            if (option != TransactionScopeOption.Suppress)
            {
                Logger.Warn(Messages.SynchronousDispatcherTwoPhaseCommits);
            }

            Logger.Debug(Messages.AsyncDispatchSchedulerRegistered);
            Startup(startup);
            DispatchTo(dispatcher ?? new NullDispatcher());
            Container.Register <IScheduleDispatches>(c =>
            {
                var dispatchScheduler = new AsynchronousDispatchScheduler(
                    c.Resolve <IDispatchCommits>(),
                    c.Resolve <IPersistStreams>());
                if (c.Resolve <DispatcherSchedulerStartup>() == DispatcherSchedulerStartup.Auto)
                {
                    dispatchScheduler.Start();
                }
                return(dispatchScheduler);
            });
        }
 protected override void Context()
 {
     _dispatchScheduler = new AsynchronousDispatchScheduler(dispatcher, persistence);
     _dispatchScheduler.Start();
 }