protected override void Context() { dispatcher.Setup(x => x.Dispatch(commit)); persistence.Setup(x => x.MarkCommitAsDispatched(commit)); dispatchScheduler = new AsynchronousDispatchScheduler(dispatcher.Object, persistence.Object); }
public AsynchronousDispatchSchedulerWireup(Wireup wireup, IDispatchCommits dispatcher, DispatcherSchedulerStartup schedulerStartup) : base(wireup) { var option = Container.Resolve<TransactionScopeOption>(); if (option != TransactionScopeOption.Suppress) { Logger.Warn(Messages.SynchronousDispatcherTwoPhaseCommits); } Logger.Debug(Messages.AsyncDispatchSchedulerRegistered); DispatchTo(dispatcher ?? new NullDispatcher()); Container.Register<IScheduleDispatches>(c => { var dispatchScheduler = new AsynchronousDispatchScheduler( c.Resolve<IDispatchCommits>(), c.Resolve<IPersistStreams>()); if (schedulerStartup == DispatcherSchedulerStartup.Auto) { dispatchScheduler.Start(); } return dispatchScheduler; }); }
protected override void Context() { _dispatchScheduler = new AsynchronousDispatchScheduler(dispatcher, persistence); _dispatchScheduler.Start(); }