Example #1
0
 public IrisDisposableSubscription(IIrisNode irisNode, string channel, ContentHandler contentHandler)
 {
     _irisNode      = irisNode;
     Channel        = channel;
     ContentHandler = contentHandler;
     IsDisposed     = false;
 }
Example #2
0
        public void Dispose()
        {
            if (!IsDisposed)
            {
                if (Channel == null)
                {
                    _irisNode?.UnsubscribeFromBroadcast(ContentHandler);
                }
                else
                {
                    _irisNode?.Unsubscribe(Channel, ContentHandler);
                }

                _irisNode           = null;
                this.ContentHandler = null;
                IsDisposed          = true;
            }
        }