public CalcEngineApiClient( IHttpClientFactory httpClientFactory, ILogger logger, ICancellationTokenProvider cancellationTokenProvider = null) : base(httpClientFactory, HttpClientKeys.CalcEngine, logger, cancellationTokenProvider) { }
public MongoDbTransactionApi( IClientSessionHandle sessionHandle, ICancellationTokenProvider cancellationTokenProvider) { SessionHandle = sessionHandle; CancellationTokenProvider = cancellationTokenProvider; }
public NuGetService( IJsonSerializer jsonSerializer, ICancellationTokenProvider cancellationTokenProvider) { JsonSerializer = jsonSerializer; CancellationTokenProvider = cancellationTokenProvider; }
public FundingDataZoneApiClient( IHttpClientFactory httpClientFactory, ILogger logger, ICancellationTokenProvider cancellationTokenProvider = null) : base(httpClientFactory, HttpClientKeys.FDZ, logger, cancellationTokenProvider) { }
protected BackgroundServiceTask( ILogger logger, ICancellationTokenProvider cancellationTokenProvider) { Logger = logger; CancellationToken = cancellationTokenProvider.CancellationToken; }
public SpecificationsApiClient(IHttpClientFactory httpClientFactory, ILogger logger, ICancellationTokenProvider cancellationTokenProvider = null, string clientKey = null) : base(httpClientFactory, clientKey ?? HttpClientKeys.Specifications, logger, cancellationTokenProvider) { }
public IdentityUserManager( IdentityUserStore store, IIdentityRoleRepository roleRepository, IIdentityUserRepository userRepository, IOptions <IdentityOptions> optionsAccessor, IPasswordHasher <IdentityUser> passwordHasher, IEnumerable <IUserValidator <IdentityUser> > userValidators, IEnumerable <IPasswordValidator <IdentityUser> > passwordValidators, IdentityUserOrganizationUnitRepository userOrganizationUnitRepository, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, ILogger <IdentityUserManager> logger, ICancellationTokenProvider cancellationTokenProvider) : base( store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger) { RoleRepository = roleRepository; UserOrganizationUnitRepository = userOrganizationUnitRepository; UserRepository = userRepository; CancellationTokenProvider = cancellationTokenProvider; }
public ReadQueue( string queueName, string messageQueueHostServerName, IMessageQueueService messageQueueService, ILogger logger, IEnvironment environment, ICancellationTokenProvider cancellationTokenProvider, bool isTransactional = true, bool auditActivity = true, bool defaultRecoverable = true, string multicastAddress = null) : base( logger, environment, queueName, messageQueueHostServerName, multicastAddress, QueueMode.Recv, isTransactional, auditActivity, defaultRecoverable, messageQueueService) { this.cancellationToken = cancellationTokenProvider.CancellationToken; }
public MyGetPackageListFinder(CliHttpClientFactory cliHttpClientFactory, ICancellationTokenProvider cancellationTokenProvider) { _cliHttpClientFactory = cliHttpClientFactory; CancellationTokenProvider = cancellationTokenProvider; Logger = NullLogger <MyGetPackageListFinder> .Instance; }
public ScheduledTaskRunner( string name, ITaskScheduler scheduler, IServiceTask scheduledTask, ITaskRepository taskRepository, IDateTimeProvider dateTimeProvider, IExceptionLogger exceptionLogger, ICancellationTokenProvider cancellationTokenProvider, ILogger logger) { this.Name = name; this.Scheduler = scheduler; this.ServiceTask = scheduledTask; this.taskRepository = taskRepository; this.dateTimeProvider = dateTimeProvider; this.exceptionLogger = exceptionLogger; this.logger = logger; this.CancellationToken = cancellationTokenProvider.CancellationToken; var lastRunTime = this.taskRepository.GetLastExecution(this.Name); this.LastRunTime = lastRunTime ?? DateTime.MinValue; this.FailureCount = 0; }
public CliAnalyticsCollect(ICancellationTokenProvider cancellationTokenProvider, IJsonSerializer jsonSerializer) { _cancellationTokenProvider = cancellationTokenProvider; _jsonSerializer = jsonSerializer; _logger = NullLogger <CliAnalyticsCollect> .Instance; }
public DynamicHttpProxyInterceptor( IDynamicProxyHttpClientFactory httpClientFactory, IOptions <AbpHttpClientOptions> clientOptions, IOptionsSnapshot <AbpRemoteServiceOptions> remoteServiceOptions, IApiDescriptionFinder apiDescriptionFinder, IJsonSerializer jsonSerializer, IRemoteServiceHttpClientAuthenticator clientAuthenticator, ICancellationTokenProvider cancellationTokenProvider, ICorrelationIdProvider correlationIdProvider, IOptions <AbpCorrelationIdOptions> correlationIdOptions, ICurrentTenant currentTenant) { CancellationTokenProvider = cancellationTokenProvider; CorrelationIdProvider = correlationIdProvider; CurrentTenant = currentTenant; AbpCorrelationIdOptions = correlationIdOptions.Value; HttpClientFactory = httpClientFactory; ApiDescriptionFinder = apiDescriptionFinder; JsonSerializer = jsonSerializer; ClientAuthenticator = clientAuthenticator; ClientOptions = clientOptions.Value; AbpRemoteServiceOptions = remoteServiceOptions.Value; Logger = NullLogger <DynamicHttpProxyInterceptor <TService> > .Instance; }
protected ScheduledTask( ILogger logger, ICancellationTokenProvider cancellationTokenProvider) { this.Logger = logger; this.CancellationToken = cancellationTokenProvider.CancellationToken; }
public CalculationsApiClient( IHttpClientFactory httpClientFactory, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) : base(httpClientFactory, Common.ApiClient.HttpClientKeys.Calculations, logger, cancellationTokenProvider) { }
/// <summary> /// ctor /// </summary> /// <param name="client">An HTTP client</param> /// <param name="options">The options.</param> /// <param name="loggerFactory">The logger factory</param> /// <param name="cancellationTokenProvider"></param> public DefaultJwtRequestUriHttpClient(HttpClient client, IdentityServerOptions options, ILoggerFactory loggerFactory, ICancellationTokenProvider cancellationTokenProvider) { _client = client; _options = options; _logger = loggerFactory.CreateLogger <DefaultJwtRequestUriHttpClient>(); _cancellationTokenProvider = cancellationTokenProvider; }
public DistributedInterceptCache(IOptions <LmsDistributedCacheOptions> distributedCacheOption, IDistributedCache cache, ICancellationTokenProvider cancellationTokenProvider, IDistributedCacheSerializer serializer, IDistributedCacheKeyNormalizer keyNormalizer) : base(distributedCacheOption, cache, cancellationTokenProvider, serializer, keyNormalizer) { }
public PeerDeltaHistoryRequest(ILogger logger, IPeerClient peerClient, IPeerSettings peerSettings, ICancellationTokenProvider cancellationTokenProvider, IScheduler observableScheduler = null) : base(logger, peerSettings.PeerId, cancellationTokenProvider, peerClient) { DeltaHistoryResponseMessageStreamer = new ReplaySubject <IPeerDeltaHistoryResponse>(1, observableScheduler ?? Scheduler.Default); }
public IdentityModelAuthenticationService( IOptions <IdentityClientOptions> options, ICancellationTokenProvider cancellationTokenProvider) { CancellationTokenProvider = cancellationTokenProvider; ClientOptions = options.Value; Logger = NullLogger <IdentityModelAuthenticationService> .Instance; }
public ProfilingApiClient( IHttpClientFactory httpClientFactory, string clientKey, ILogger logger, IBearerTokenProvider bearerTokenProvider, ICancellationTokenProvider cancellationTokenProvider = null) : base(httpClientFactory, clientKey, logger, bearerTokenProvider, cancellationTokenProvider) { }
/// <summary> /// Protocol for querying a peers current delta height. /// </summary> /// <param name="logger"></param> /// <param name="peerClient"></param> /// <param name="peerSettings"></param> /// <param name="cancellationTokenProvider"></param> /// <param name="scheduler"></param> public PeerQueryTipRequestRequest(ILogger logger, IPeerClient peerClient, IPeerSettings peerSettings, ICancellationTokenProvider cancellationTokenProvider, IScheduler scheduler = null) : base(logger, peerSettings.PeerId, cancellationTokenProvider, peerClient) { QueryTipResponseMessageStreamer = new ReplaySubject <IPeerQueryTipResponse>(1, scheduler ?? Scheduler.Default); }
public UnitOfWorkDbContextProvider( IUnitOfWorkManager unitOfWorkManager, IConnectionStringResolver connectionStringResolver, ICancellationTokenProvider cancellationTokenProvider) { _unitOfWorkManager = unitOfWorkManager; _connectionStringResolver = connectionStringResolver; _cancellationTokenProvider = cancellationTokenProvider; }
/// <summary> /// 初始化一个<see cref="Repository{TEntity, TKey}"/>类型的新实例 /// </summary> public Repository(IServiceProvider serviceProvider) { UnitOfWork = serviceProvider.GetUnitOfWork <TEntity, TKey>(); _dbContext = UnitOfWork.GetDbContext <TEntity, TKey>(); _dbSet = ((DbContext)_dbContext).Set <TEntity>(); _logger = serviceProvider.GetLogger <Repository <TEntity, TKey> >(); _cancellationTokenProvider = serviceProvider.GetService <ICancellationTokenProvider>(); _principal = serviceProvider.GetService <IPrincipal>(); }
public ModuleInfoProvider( IJsonSerializer jsonSerializer, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler) { JsonSerializer = jsonSerializer; CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; }
protected ProtocolRequestBase(ILogger logger, PeerId senderIdentifier, ICancellationTokenProvider cancellationTokenProvider, IPeerClient peerClient) : base(senderIdentifier) { Logger = logger; CancellationTokenProvider = cancellationTokenProvider; PeerClient = peerClient; }
public LoginCommand(AuthService authService, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler) { AuthService = authService; CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; Logger = NullLogger <LoginCommand> .Instance; }
public static IServiceCollection AddProfilingInterServiceClient(this IServiceCollection builder, IConfiguration config, TimeSpan[] retryTimeSpans = null, int numberOfExceptionsBeforeCircuitBreaker = 100, TimeSpan circuitBreakerFailurePeriod = default, TimeSpan handlerLifetime = default) { if (retryTimeSpans == null) { retryTimeSpans = new[] { TimeSpan.FromMilliseconds(500), TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5) }; } if (circuitBreakerFailurePeriod == default) { circuitBreakerFailurePeriod = TimeSpan.FromMinutes(1); } var httpBuilder = builder.AddHttpClient(HttpClientKeys.Profiling, (httpClient) => { ApiOptions apiOptions = new ApiOptions(); config.Bind(ClientName, apiOptions); ApiClientConfigurationOptions.SetDefaultApiClientConfigurationOptions(httpClient, apiOptions); }) .ConfigurePrimaryHttpMessageHandler(() => new ApiClientHandler()) .AddTransientHttpErrorPolicy(c => c.WaitAndRetryAsync(retryTimeSpans)) .AddTransientHttpErrorPolicy(c => c.CircuitBreakerAsync(numberOfExceptionsBeforeCircuitBreaker, circuitBreakerFailurePeriod)) .AddUserProfilerHeaderPropagation(); // if a life time for the handler has been set then set it on the client builder if (handlerLifetime != default) { httpBuilder.SetHandlerLifetime(Timeout.InfiniteTimeSpan); } builder.AddSingleton <ICancellationTokenProvider, InactiveCancellationTokenProvider>(); builder.AddSingleton <IAzureBearerTokenProxy, AzureBearerTokenProxy>(); builder.AddSingleton <IProfilingApiClient>((ctx) => { IHttpClientFactory httpClientFactory = ctx.GetService <IHttpClientFactory>(); ILogger logger = ctx.GetService <ILogger>(); ICancellationTokenProvider cancellationTokenProvider = ctx.GetService <ICancellationTokenProvider>(); IAzureBearerTokenProxy azureBearerTokenProxy = ctx.GetService <IAzureBearerTokenProxy>(); ICacheProvider cacheProvider = ctx.GetService <ICacheProvider>(); AzureBearerTokenOptions azureBearerTokenOptions = new AzureBearerTokenOptions(); config.Bind("providerProfilingAzureBearerTokenOptions", azureBearerTokenOptions); AzureBearerTokenProvider bearerTokenProvider = new AzureBearerTokenProvider(azureBearerTokenProxy, cacheProvider, azureBearerTokenOptions); return(new ProfilingApiClient(httpClientFactory, HttpClientKeys.Profiling, logger, bearerTokenProvider, cancellationTokenProvider)); }); return(builder); }
public TemplateInfoProvider(ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, AuthService authService) { CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; AuthService = authService; Logger = NullLogger <TemplateInfoProvider> .Instance; }
public CliAnalyticsCollect( ICancellationTokenProvider cancellationTokenProvider, IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler) { _cancellationTokenProvider = cancellationTokenProvider; _jsonSerializer = jsonSerializer; _remoteServiceExceptionHandler = remoteServiceExceptionHandler; _logger = NullLogger <CliAnalyticsCollect> .Instance; }
public NpmPackagesUpdater( PackageJsonFileFinder packageJsonFileFinder, NpmGlobalPackagesChecker npmGlobalPackagesChecker, ICancellationTokenProvider cancellationTokenProvider) { _packageJsonFileFinder = packageJsonFileFinder; _npmGlobalPackagesChecker = npmGlobalPackagesChecker; CancellationTokenProvider = cancellationTokenProvider; Logger = NullLogger <NpmPackagesUpdater> .Instance; }
public EfCoreTransactionApi( IDbContextTransaction dbContextTransaction, IEfCoreDbContext starterDbContext, ICancellationTokenProvider cancellationTokenProvider) { DbContextTransaction = dbContextTransaction; StarterDbContext = starterDbContext; CancellationTokenProvider = cancellationTokenProvider; AttendedDbContexts = new List <IEfCoreDbContext>(); }