private static CircuitRegistry CreateRegistry(CircuitIdFactory factory = null) { return(new CircuitRegistry( Options.Create(new CircuitOptions()), NullLogger <CircuitRegistry> .Instance, factory ?? TestCircuitIdFactory.CreateTestFactory())); }
public DefaultCircuitFactory( IServiceScopeFactory scopeFactory, ILoggerFactory loggerFactory, CircuitIdFactory circuitIdFactory) { _scopeFactory = scopeFactory ?? throw new ArgumentNullException(nameof(scopeFactory)); _loggerFactory = loggerFactory; _circuitIdFactory = circuitIdFactory ?? throw new ArgumentNullException(nameof(circuitIdFactory)); }
public CircuitFactory( IServiceScopeFactory scopeFactory, ILoggerFactory loggerFactory, CircuitIdFactory circuitIdFactory, IOptions <CircuitOptions> options) { _scopeFactory = scopeFactory; _loggerFactory = loggerFactory; _circuitIdFactory = circuitIdFactory; _options = options.Value; _logger = _loggerFactory.CreateLogger <CircuitFactory>(); }
public DefaultCircuitFactory( IServiceScopeFactory scopeFactory, ILoggerFactory loggerFactory, CircuitIdFactory circuitIdFactory, IOptions <CircuitOptions> options) { _scopeFactory = scopeFactory ?? throw new ArgumentNullException(nameof(scopeFactory)); _loggerFactory = loggerFactory; _logger = _loggerFactory.CreateLogger <CircuitFactory>(); _circuitIdFactory = circuitIdFactory ?? throw new ArgumentNullException(nameof(circuitIdFactory)); _options = options.Value; }
public CircuitRegistry( IOptions <CircuitOptions> options, ILogger <CircuitRegistry> logger, CircuitIdFactory circuitIdFactory) { _options = options.Value; _logger = logger; _circuitIdFactory = circuitIdFactory; ConnectedCircuits = new ConcurrentDictionary <string, CircuitHost>(StringComparer.Ordinal); DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions { SizeLimit = _options.DisconnectedCircuitMaxRetained, }); _postEvictionCallback = new PostEvictionCallbackRegistration { EvictionCallback = OnEntryEvicted, }; }
public TestCircuitRegistry(CircuitIdFactory factory) : base(Options.Create(new CircuitOptions()), NullLogger <CircuitRegistry> .Instance, factory) { }