コード例 #1
0
ファイル: Connection.cs プロジェクト: 2r0ck/CoreNetCore
 public Connection(IAppId appId, IPrepareConfigService configuration, IHealthcheck healthcheck)
 {
     Configuration = configuration;
     IsConnected   = false;
     AppId         = appId;
     healthcheck.AddCheck(() => IsConnected);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        // 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();
                }
            };
        }
コード例 #4
0
ファイル: MoskService.cs プロジェクト: 2r0ck/CoreNetCore
 public MyTestService(ICoreDispatcher dispatcher, IPrepareConfigService config) : base(dispatcher)
 {
     this.config = config;
 }
コード例 #5
0
ファイル: Healthcheck.cs プロジェクト: 2r0ck/CoreNetCore
 public Healthcheck(IPrepareConfigService configuration)
 {
     checks   = new List <Func <bool> >();
     ConfigMq = configuration.MQ;
 }