예제 #1
0
 public RPCClient(int millisecondsTimeout)
 {
     _busItem = RabbitBus.Borrow(RPC.Policy);
     InitConsumer();
     _signal = new AutoResetEvent(false);
     _millisecondsTimeout = millisecondsTimeout;
 }
예제 #2
0
 public EventSubscriber(string eventName, string group)
 {
     _eventName = eventName;
     _queue     = string.Format("{0}-{1}", eventName, group);
     _isWorking = false;
     _busItem   = RabbitBus.Borrow(Event.Policy);
 }
예제 #3
0
 public void Publish(string eventName, DTObject arg)
 {
     using (var temp = RabbitBus.Borrow(Event.Policy))
     {
         var bus = temp.Item;
         bus.ExchangeDeclare(Event.Exchange, ExchangeType.Topic);
         var routingKey = eventName;
         bus.Publish(Event.Exchange, routingKey, arg);
     }
 }
예제 #4
0
 public RPCServer(string method)
 {
     _busItem = RabbitBus.Borrow(RPC.Policy);
     _queue   = RPC.GetServerQueue(method);
 }