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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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>;
 }
Exemplo n.º 5
0
 public Carrot(TMsg message, ulong deilvered, PermanentChannel thisChannel)
 {
     _message     = message;
     _deilvered   = deilvered;
     _thisChannel = thisChannel;
 }