本文整理汇总了C#中IServiceBus.Subscribe方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceBus.Subscribe方法的具体用法?C# IServiceBus.Subscribe怎么用?C# IServiceBus.Subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceBus
的用法示例。
在下文中一共展示了IServiceBus.Subscribe方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartService
private void StartService()
{
StopService();
try
{
_container = new DefaultMassTransitContainer("Server.Castle.xml");
_bus = _container.Resolve<IServiceBus>("server");
//_controlBus = _container.Resolve<IServiceBus>("control");
_container.AddComponent<UserAgentSession>();
_container.AddComponent<TheAnswerMan>();
_bus.Subscribe<UserAgentSession>();
_bus.Subscribe<TheAnswerMan>();
messageTimer.Start();
}
catch (Exception ex)
{
_log.Error(ex);
MessageBox.Show("The server failed to start:\n\n" + ex.Message);
}
}
示例2: Start
public void Start(IServiceBus bus)
{
_bus = bus;
_controlBus = bus.ControlBus;
_unsubscribe += _controlBus.Subscribe<Acceptor<AvailableGridServiceNode>>();
_unsubscribe += _controlBus.Subscribe<Learner<AvailableGridServiceNode>>();
}
示例3: Start
public void Start()
{
_bus = ServiceLocator.Current.GetInstance<IServiceBus>("server");
_bus.Subscribe<Responder>();
_bus.Subscribe<RegisterUserSaga>();
Console.WriteLine("Service running...");
}
示例4: Start
public override void Start()
{
_bus = base.ServiceLocator.GetInstance<IServiceBus>("server");
_bus.Subscribe<SendEmailConsumer>();
Console.WriteLine("Service running...");
}
示例5: MainForm_Load
private void MainForm_Load(object sender, EventArgs e)
{
_bus = ObjectFactory.GetInstance<IServiceBus>();
_unsubscribe = _bus.Subscribe<SubTaskWorker<GenerateMandelbrotWorker, GenerateRow, RowGenerated>>();
_worker = new BackgroundWorker();
_worker.DoWork += worker_DoWork;
_worker.RunWorkerCompleted += worker_RunWorkerCompleted;
var task = new GenerateMandelbrotTask(_viewer.Width, _viewer.Height, 1000);
_worker.RunWorkerAsync(task);
}
示例6: Start
public void Start(IServiceBus bus)
{
_bus = bus;
_bus.Subscribe<PasswordUpdater>();
Console.WriteLine(new string('-', 20));
Console.WriteLine("New Password Client");
Console.WriteLine("What would you like to set your new password to?");
Console.Write("New Password:");
string newPassword = Console.ReadLine();
Console.WriteLine(new string('-', 20));
var message = new RequestPasswordUpdate(newPassword);
_bus.Publish(message);
Console.WriteLine("Waiting For Reply with CorrelationId '{0}'", message.CorrelationId);
Console.WriteLine(new string('-', 20));
}
示例7: StartClient
private void StartClient()
{
StopClient();
try
{
_container = new DefaultMassTransitContainer("Client.Castle.xml");
_bus = _container.Resolve<IServiceBus>("client");
_container.AddComponent<TimeoutWatcher>();
_bus.Subscribe<TimeoutWatcher>();
}
catch (Exception ex)
{
_log.Error(ex);
MessageBox.Show("The client failed to start:\n\n" + ex.Message);
}
}
示例8: Start
public void Start()
{
_bus = ServiceLocator.Current.GetInstance<IServiceBus>("server");
_unsubscribeToken = _bus.Subscribe<InventoryLevelService>();
}
示例9: Start
public void Start()
{
_bus = ServiceLocator.Current.GetInstance<IServiceBus>();
_unsubscribeAction = _bus.Subscribe<DrinkPreparationSaga>();
}