Exemplo n.º 1
0
        /// <summary>Stop and remove a subscription</summary>
        public async Task Remove(Subscription sub)
        {
            Debug.Assert(Misc.AssertMainThread());

            // Stop if active
            await sub.Stop();

            // Remove from the active subscriptions lookup table
            if (sub.ChannelId != null)
            {
                Active.Remove(sub.ChannelId.Value);
            }

            // Remove from the subs collection
            Subs.Remove(sub);
            sub.Api = null;
        }