Пример #1
0
 public void Dispose()
 {
     if (this._handleRef.Handle != IntPtr.Zero)
     {
         ProducerWrap.DestroyProducer(this._handleRef);
         this._handleRef = new HandleRef(null, IntPtr.Zero);
         GC.SuppressFinalize(this);
     }
 }
Пример #2
0
        public bool DestroyProducer()
        {
            var destroyResult = ProducerWrap.DestroyProducer(this._handleRef);

            if (this._diagnosticListener?.IsEnabled(ConstValues.RocketMQProducerDestroy) ?? false)
            {
                this._diagnosticListener.Write(ConstValues.RocketMQProducerDestroy, new
                {
                    destroyResult
                });
            }

            return(destroyResult == 0);
        }