Пример #1
0
 /// <summary>
 ///     Create a Resilient Client.
 /// </summary>
 /// <param name="client">
 ///     A <see cref="IBrowsingClient" /> to proxy to. The resilient client takes ownership of
 ///     <paramref name="client" /> and will dispose it when the resilient cache itself is disposed. If you
 ///     reference or dispose <paramref name="client" /> after you create the resilient cache, the behavior of
 ///     the resilient cache and <paramref name="client" /> is undefined.
 /// </param>
 /// <returns>
 ///     A resilient client.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">
 ///     Thrown if <paramref name="client" /> is a null reference.
 /// </exception>
 public static ResilientBrowsingClient Create(IBrowsingClient client) => ResilientBrowsingClient.Create(client, 5);
Пример #2
0
 /// <summary>
 ///     Create a Resilient Client.
 /// </summary>
 /// <param name="client">
 ///     A <see cref="IBrowsingClient" /> to proxy to. The resilient client takes ownership of
 ///     <paramref name="client" /> and will dispose it when the resilient cache itself is disposed. If you
 ///     reference or dispose <paramref name="client" /> after you create the resilient cache, the behavior of
 ///     the resilient cache and <paramref name="client" /> is undefined.
 /// </param>
 /// <param name="retryAttempts">
 ///     The number of attempts a failed operation should be retried.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 ///     Thrown if <paramref name="client" /> is a null reference.
 /// </exception>
 /// <exception cref="System.ArgumentOutOfRangeException">
 ///     Thrown if <paramref name="retryAttempts" /> is less than or equal to <c>0</c>.
 /// </exception>
 public static ResilientBrowsingClient Create(IBrowsingClient client, int retryAttempts) => ResilientBrowsingClient.Create(client, retryAttempts, true);