Ejemplo n.º 1
0
 public RPCClient(int millisecondsTimeout)
 {
     _busItem = RabbitBus.Borrow(RPC.Policy);
     InitConsumer();
     _signal = new AutoResetEvent(false);
     _millisecondsTimeout = millisecondsTimeout;
 }
Ejemplo n.º 2
0
 public EventSubscriber(string eventName, string group)
 {
     _eventName = eventName;
     _queue     = string.Format("{0}-{1}", eventName, group);
     _isWorking = false;
     _busItem   = RabbitBus.Borrow(Event.Policy);
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 4
0
 public RPCServer(string method)
 {
     _busItem = RabbitBus.Borrow(RPC.Policy);
     _queue   = RPC.GetServerQueue(method);
 }