public Connection(IAppId appId, IPrepareConfigService configuration, IHealthcheck healthcheck) { Configuration = configuration; IsConnected = false; AppId = appId; healthcheck.AddCheck(() => IsConnected); }
public CoreHost(IServiceProvider serviceProvider, ICoreDispatcher dispatcher, IHealthcheck healthcheck, ICoreConnection coreConnection, IApplicationLifetime appLifetime) { _appLifetime = appLifetime ?? throw new CoreException("AppLifetime not defined"); _serviceProvider = serviceProvider ?? throw new CoreException("ServiceProvider not defined"); _coreConnection = coreConnection ?? throw new CoreException("CoreConnection not defined"); _healthcheck = healthcheck ?? throw new CoreException("Healthcheck not defined"); _dispatcher = dispatcher ?? throw new CoreException("CoreDispatcher not defined"); //SIG handlers appLifetime.ApplicationStarted.Register(OnStarted); appLifetime.ApplicationStopping.Register(OnStopping); appLifetime.ApplicationStopped.Register(OnStopped); }
public CoreDispatcher(IPrepareConfigService config, IAppId appId, ICoreConnection coreConnection, IResolver resolver, IHealthcheck healthcheck) { Config = config; AppId = appId.CurrentUID; Connection = coreConnection; Resolver = resolver; healthcheck.AddCheck(() => running); Resolver.Stopped += (appid) => { running = false; }; Resolver.Started += Resolver_Started; }
// public ConcurrentDictionary<string, List<ResolverInvoker>> pending = new ConcurrentDictionary<string, List<ResolverInvoker>>(); public Resolver(IMemoryCache memoryCache, ICoreConnection connection, IPrepareConfigService configuration, IHealthcheck healthcheck, IAppId appId) { Configuration = configuration; AppId = appId.CurrentUID; Connection = connection; Cache = memoryCache; Bind = false; healthcheck.AddCheck(() => Bind); connection.Connected += Connection_Connected; connection.Disconnected += (appid) => { Bind = false; Stopped?.Invoke(appid); if (cancellationRefreshCache != null) { Trace.TraceInformation("Cache refresh stopped"); cancellationRefreshCache.Cancel(); } }; }