internal DeclarePublisher(IBunny bunny, string publishTo)
 {
     _bunny       = bunny;
     _publishTo   = publishTo;
     _serialize   = Config.Serialize;
     _thisChannel = new PermanentChannel(bunny);
 }
 public DeclareConsumer(IBunny bunny, string fromQueue)
 {
     _bunny            = bunny;
     _deserialize      = Config.Deserialize <TMsg>;
     _consumeFromQueue = fromQueue;
     _thisChannel      = new PermanentChannel(bunny);
     _receive          = async carrot => await carrot.SendAckAsync();
 }
예제 #3
0
 internal DeclareRequest(IBunny bunny, string toExchange, string routingKey)
 {
     _bunny       = bunny;
     _toExchange  = toExchange;
     _routingKey  = routingKey;
     _serialize   = Config.Serialize;
     _deserialize = Config.Deserialize <TResponse>;
     _thisChannel = new PermanentChannel(_bunny);
 }
예제 #4
0
 public DeclareResponder(IBunny bunny, string rpcExchange, string fromQueue, Func <TRequest, Task <TResponse> > respond)
 {
     if (respond == null)
     {
         throw DeclarationException.Argument(new ArgumentException("respond delegate must not be null"));
     }
     _bunny            = bunny;
     _respond          = respond;
     _rpcExchange      = rpcExchange;
     _serialize        = Config.Serialize;
     _consumeFromQueue = fromQueue;
     _thisChannel      = new PermanentChannel(bunny);
     _deserialize      = Config.Deserialize <TRequest>;
 }
예제 #5
0
 public Carrot(TMsg message, ulong deilvered, PermanentChannel thisChannel)
 {
     _message     = message;
     _deilvered   = deilvered;
     _thisChannel = thisChannel;
 }