Exemplo n.º 1
0
 public PublishChannel(MQPool pool, IModel channel)
 {
     if (pool == null)
     {
         throw new ArgumentNullException(nameof(pool));
     }
     if (channel == null)
     {
         throw new ArgumentNullException(nameof(channel));
     }
     this.pool    = pool;
     this.Channel = channel;
 }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (this.pool != null)
     {
         if (this.pool.maxPool > this.pool.m_publishChannelQueue.Count && this.Channel.IsOpen)
         {
             this.pool.m_publishChannelQueue.Enqueue(this.Channel);
         }
         else
         {
             if (this.Channel.IsOpen)
             {
                 this.Channel.Close();
             }
             this.Channel.Dispose();
         }
     }
     this.pool    = null;
     this.Channel = null;
 }