예제 #1
0
 internal Policies(ILoadBalancingPolicy loadBalancingPolicy,
                   IReconnectionPolicy reconnectionPolicy,
                   IRetryPolicy retryPolicy,
                   ISpeculativeExecutionPolicy speculativeExecutionPolicy,
                   ITimestampGenerator timestampGenerator)
 {
     _loadBalancingPolicy        = loadBalancingPolicy ?? DefaultLoadBalancingPolicy;
     _reconnectionPolicy         = reconnectionPolicy ?? DefaultReconnectionPolicy;
     _retryPolicy                = retryPolicy ?? DefaultRetryPolicy;
     _speculativeExecutionPolicy = speculativeExecutionPolicy ?? DefaultSpeculativeExecutionPolicy;
     _timestampGenerator         = timestampGenerator ?? DefaultTimestampGenerator;
     _extendedRetryPolicy        = _retryPolicy.Wrap(DefaultExtendedRetryPolicy);
 }
예제 #2
0
 /// <summary>
 /// Sets the current policy as extended retry policy.
 /// If the current policy is not <see cref="IExtendedRetryPolicy"/>, it creates a wrapper to delegate
 /// the methods that were not implemented to a default policy.
 /// </summary>
 internal void InitializeRetryPolicy(ICluster cluster)
 {
     _extendedRetryPolicy = _retryPolicy.Wrap(null);
 }