Skip to content

Instantly share code, notes, and snippets.

@mfloryan
Created July 12, 2014 08:20
Show Gist options
  • Select an option

  • Save mfloryan/933da697dcf97aca23c3 to your computer and use it in GitHub Desktop.

Select an option

Save mfloryan/933da697dcf97aca23c3 to your computer and use it in GitHub Desktop.
public DistributorThrottler(
IDistributorProviderConfiguration distributorProviderConfiguration,
IPropertySource propertyStore) {
counter = new Counter();
numberOfProviders = distributorProviderConfiguration.NumberOfEnabledProviders;
var maximumPossibleRequestsInFlight =
HomeDistributorProviderProperty
.ProviderMaxRequestsPending
.From(propertyStore).ToInt() * numberOfProviders;
public DistributorThrottler(
int numberOfProviders,
IPropertySource propertyStore) {
counter = new Counter();
this.numberOfProviders = numberOfProviders;
var maximumPossibleRequestsInFlight =
HomeDistributorProviderProperty
.ProviderMaxRequestsPending
.From(propertyStore).ToInt() * this.numberOfProviders;
var distributorProviderConfigurationMock =
MockRepository.GenerateMock<DistributorProviderConfiguration>
(propertyStoreMock, new FeatureSet());
distributorProviderConfigurationMock
.Stub(c => c.NumberOfEnabledProviders)
.Return(2);
throttler = new DistributorThrottler(
distributorProviderConfigurationMock,
propertyStoreMock);
throttler = new DistributorThrottler(propertyStoreMock, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment