本文整理汇总了C#中IEventPublisher.Start方法的典型用法代码示例。如果您正苦于以下问题:C# IEventPublisher.Start方法的具体用法?C# IEventPublisher.Start怎么用?C# IEventPublisher.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEventPublisher
的用法示例。
在下文中一共展示了IEventPublisher.Start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebApiApplication
static WebApiApplication()
{
try
{
Configuration.Instance.UseLog4Net()
.RegisterMessageContextType(typeof(MessageContext));
_Logger = IoCFactory.Resolve<ILoggerFactory>().Create(typeof(WebApiApplication));
_CommandDistributor = new CommandDistributor("tcp://127.0.0.1:5000",
new string[] {
"tcp://127.0.0.1:5001"
, "tcp://127.0.0.1:5002"
, "tcp://127.0.0.1:5003"
}
);
Configuration.Instance.RegisterCommandConsumer(_CommandDistributor, "CommandDistributor")
.CommandHandlerProviderBuild(null, "CommandHandlers")
.RegisterDisposeModule()
.RegisterMvc();
_EventPublisher = IoCFactory.Resolve<IEventPublisher>();
_EventPublisher.Start();
_DomainEventConsumer = IoCFactory.Resolve<IMessageConsumer>("DomainEventConsumer");
_DomainEventConsumer.Start();
_ApplicationEventConsumer = IoCFactory.Resolve<IMessageConsumer>("ApplicationEventConsumer");
_ApplicationEventConsumer.Start();
var commandHandlerProvider = IoCFactory.Resolve<ICommandHandlerProvider>();
_CommandConsumer1 = new CommandConsumer(commandHandlerProvider,
"tcp://127.0.0.1:5001");
_CommandConsumer2 = new CommandConsumer(commandHandlerProvider,
"tcp://127.0.0.1:5002");
_CommandConsumer3 = new CommandConsumer(commandHandlerProvider,
"tcp://127.0.0.1:5003");
_CommandConsumer1.Start();
_CommandConsumer2.Start();
_CommandConsumer3.Start();
_CommandDistributor.Start();
_CommandBus = IoCFactory.Resolve<ICommandBus>() as IMessageConsumer;
_CommandBus.Start();
}
catch (Exception ex)
{
_Logger.Error(ex.GetBaseException().Message, ex);
}
}