public override void Subscribe(EventDeclare eventDeclare) { var ed = eventDeclare; if (ed.IsCopy) { return; } var thread = new Core.ThreadWork() { Args = ed }; thread.Start(ed.Name, SubscribeData, ed.ThreadSleepSecond); threads.Add(thread); }
public override void Subscribe(EventDeclare eventDeclare) { var queueName = _queueConfig.QueueName; if (!string.IsNullOrEmpty(eventDeclare.QueueName)) { queueName = eventDeclare.QueueName; } var routingKey = eventDeclare.Name; if (eventDeclare.IsCopy) { routingKey = eventDeclare.GetArrayName(); } client.Subscribe(routingKey, OnReceiveString); }
public override void SubscribeAsync(EventDeclare eventDeclare) { var queueName = _queueConfig.QueueName; if (!string.IsNullOrEmpty(eventDeclare.QueueName)) { queueName = eventDeclare.QueueName; } var routingKey = eventDeclare.Name; if (eventDeclare.IsCopy) { routingKey = eventDeclare.GetArrayName(); } //异步订阅 client.BeginReceiveAsync(queueName, routingKey, OnReceiveAsync); }
public override void SubscribeAsync(EventDeclare eventDeclare) { var ed = eventDeclare; if (ed.IsCopy) { return; } var thread = new Core.ThreadWork() { Args = ed }; thread.Start(ed.Name, (args) => { SubscribeDataSync(args).Wait(); return(true); }, ed.ThreadSleepSecond); threads.Add(thread); }
public abstract void SubscribeAsync(EventDeclare eventDeclare);