コード例 #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);
 }