コード例 #1
0
 /// <summary>
 ///  Stream queue balancer that uses Azure deployment information for load balancing.
 /// Requires silo running in Azure.
 /// This balancer supports queue balancing in cluster auto-scale scenario, unexpected server failure scenario, and try to support ideal distribution
 /// </summary>
 public static TConfigurator UseAzureDeploymentLeaseBasedBalancer <TConfigurator>(this TConfigurator configurator,
                                                                                  Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null)
     where TConfigurator : NamedServiceConfigurator, ISiloPersistentStreamConfigurator
 {
     return(configurator.ConfigurePartitionBalancing(
                (s, n) => LeaseBasedQueueBalancer.Create(s, n, new ServiceRuntimeWrapper(s.GetService <ILoggerFactory>())), configureOptions));
 }
コード例 #2
0
 public static TConfigurator UseClusterConfigDeploymentLeaseBasedBalancer <TConfigurator>(this TConfigurator configurator,
                                                                                          Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null)
     where TConfigurator : NamedServiceConfigurator, ISiloPersistentStreamConfigurator
 {
     return(configurator.ConfigurePartitionBalancing((s, n) => LeaseBasedQueueBalancer.Create(s, n, s.GetService <IOptions <StaticClusterDeploymentOptions> >().Value),
                                                     configureOptions));
 }
コード例 #3
0
 /// <summary>
 ///  Stream queue balancer that uses Azure deployment information for load balancing.
 /// Requires silo running in Azure.
 /// This balancer supports queue balancing in cluster auto-scale scenario, unexpected server failure scenario, and try to support ideal distribution
 /// </summary>
 public static void UseAzureDeploymentLeaseBasedBalancer(this ISiloPersistentStreamConfigurator configurator,
                                                         Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null)
 {
     configurator.ConfigurePartitionBalancing(
         (s, n) => LeaseBasedQueueBalancer.Create(s, n, new ServiceRuntimeWrapper(s.GetService <ILoggerFactory>())), configureOptions);
 }
コード例 #4
0
 public static void UseClusterConfigDeploymentLeaseBasedBalancer(this ISiloPersistentStreamConfigurator configurator,
                                                                 Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null)
 {
     configurator.ConfigurePartitionBalancing((s, n) => LeaseBasedQueueBalancer.Create(s, n, s.GetRequiredService <IOptions <StaticClusterDeploymentOptions> >().Value),
                                              configureOptions);
 }