Esempio 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;
 }
Esempio 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;
 }