Example #1
0
        public AzureBlobLeaseProviderTests()
            : base()
        {
            var config = new AzureBlobLeaseProviderConfig()
            {
                DataConnectionString = TestDefaultConfiguration.DataConnectionString,
                BlobContainerName    = "test-blob-container-name"
            };

            this.leaseProvider = new AzureBlobLeaseProvider(config);
        }
        private static void ConfigureServices(IServiceCollection services)
        {
            var leaseProviderConfig = new AzureBlobLeaseProviderConfig()
            {
                DataConnectionString = TestDefaultConfiguration.DataConnectionString,
                BlobContainerName    = "test-container-leasebasedqueuebalancer"
            };

            services.AddSingleton <AzureBlobLeaseProviderConfig>(leaseProviderConfig);
            services.AddTransient <AzureBlobLeaseProvider>();
        }
            private static void ConfigureServices(IServiceCollection services)
            {
                var leaseProviderConfig = new AzureBlobLeaseProviderConfig()
                {
                    DataConnectionString = TestDefaultConfiguration.DataConnectionString,
                    BlobContainerName    = "test-container-leasebasedqueuebalancer"
                };

                services.AddSingleton <AzureBlobLeaseProviderConfig>(leaseProviderConfig);
                services.AddTransient <AzureBlobLeaseProvider>();
                services.AddOptions <LeaseBasedQueueBalancerOptions>(StreamProviderName).Configure(options =>
                {
                    options.LeaseProviderType = typeof(AzureBlobLeaseProvider);
                    options.LeaseLength       = TimeSpan.FromSeconds(15);
                });
            }