示例#1
0
 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 FanoutService1(ICoreConnection coreConnection, IConfiguration configuration, IAppId appId)
 {
     CoreConnection = coreConnection;
     Configuration  = configuration;
     AppId          = appId;
 }
示例#4
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();
                }
            };
        }
示例#5
0
 public CustomService(IAppId appId)
 {
     AppId = appId.CurrentUID;
 }
示例#6
0
 public Service2(IAppId appId, IConfiguration configuration)
 {
     AppId         = appId.CurrentUID;
     Configuration = configuration;
 }