Created
July 12, 2014 08:20
-
-
Save mfloryan/933da697dcf97aca23c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public DistributorThrottler( | |
| IDistributorProviderConfiguration distributorProviderConfiguration, | |
| IPropertySource propertyStore) { | |
| counter = new Counter(); | |
| numberOfProviders = distributorProviderConfiguration.NumberOfEnabledProviders; | |
| var maximumPossibleRequestsInFlight = | |
| HomeDistributorProviderProperty | |
| .ProviderMaxRequestsPending | |
| .From(propertyStore).ToInt() * numberOfProviders; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public DistributorThrottler( | |
| int numberOfProviders, | |
| IPropertySource propertyStore) { | |
| counter = new Counter(); | |
| this.numberOfProviders = numberOfProviders; | |
| var maximumPossibleRequestsInFlight = | |
| HomeDistributorProviderProperty | |
| .ProviderMaxRequestsPending | |
| .From(propertyStore).ToInt() * this.numberOfProviders; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var distributorProviderConfigurationMock = | |
| MockRepository.GenerateMock<DistributorProviderConfiguration> | |
| (propertyStoreMock, new FeatureSet()); | |
| distributorProviderConfigurationMock | |
| .Stub(c => c.NumberOfEnabledProviders) | |
| .Return(2); | |
| throttler = new DistributorThrottler( | |
| distributorProviderConfigurationMock, | |
| propertyStoreMock); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| throttler = new DistributorThrottler(propertyStoreMock, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment