/// <summary>
        /// Deletes a subscription.
        /// </summary>
        /// <param name="subscription">Subscription to delete.</param>
        /// <param name="token">Token to observe for cancellation of the request.</param>
        /// <returns>Task to await the acknowledgement of the deletion of the subscription, or an exception.</returns>
        protected override Task DeleteSubscriptionAsyncCore(IAsyncReactiveQubscription subscription, CancellationToken token)
        {
            if (subscription == null)
            {
                throw new ArgumentNullException(nameof(subscription));
            }

            if (!TryGetUriFromKnownResource(subscription, out Uri uri))
            {
                throw new InvalidOperationException("Unknown subscription object. Could not find a URI identity for the specified subscription object. Did you obtain the subscription object from SubscribeAsync or GetSubscription?");
            }

            return(_provider.DeleteSubscriptionAsync(uri, token));
        }
Example #2
0
 /// <summary>
 /// Deletes a subscription.
 /// </summary>
 /// <param name="subscription">Subscription to delete.</param>
 /// <param name="token">Token to observe for cancellation of the request.</param>
 /// <returns>Task to await the acknowledgement of the deletion of the subscription, or an exception.</returns>
 protected abstract Task DeleteSubscriptionAsyncCore(IAsyncReactiveQubscription subscription, CancellationToken token);
Example #3
0
 internal Task DeleteSubscriptionAsync(IAsyncReactiveQubscription subscription, CancellationToken token) => DeleteSubscriptionAsyncCore(subscription, token);
Example #4
0
 /// <summary>
 /// Creates a subscription.
 /// </summary>
 /// <param name="subscription">Subscription to create.</param>
 /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param>
 /// <param name="token">Token to observe for cancellation of the request.</param>
 /// <returns>Task to await the acknowledgement of the creation of the subscription, or an exception.</returns>
 protected abstract Task CreateSubscriptionAsyncCore(IAsyncReactiveQubscription subscription, object state, CancellationToken token);
Example #5
0
 internal Task CreateSubscriptionAsync(IAsyncReactiveQubscription subscription, object state, CancellationToken token) => CreateSubscriptionAsyncCore(subscription, state, token);