public NodeMonitorWatcher(ConsulClient client, IClientWatchManager manager, string path, Action <byte[], byte[]> action)
 {
     this._action = action;
     _manager     = manager;
     _client      = client;
     _path        = path;
     RegisterWatch();
 }
 public ChildrenMonitorWatcher(IClientWatchManager clientWatchManager, ConsulClient consul, Action <string[], string[]> action, Func <string[], string[]> func, string path)
 {
     this._clientWatchManager = clientWatchManager;
     this._path   = path;
     this._consul = consul;
     this._action = action;
     this._func   = func;
     RegisterWatch();
 }
Exemple #3
0
 public NodeMonitorWatcher(ConsulClient client, IClientWatchManager manager, string path,
                           Action <byte[], byte[]> action, Func <string, bool> allowChange)
 {
     this._action = action;
     _manager     = manager;
     _client      = client;
     _path        = path;
     _allowChange = allowChange;
     RegisterWatch();
 }
Exemple #4
0
 public ChildrenMonitorWatcher(Func <ValueTask <ConsulClient> > clientCall, IClientWatchManager manager, string path,
                               Action <string[], string[]> action, Func <string[], string[]> func)
 {
     this._action = action;
     _manager     = manager;
     _clientCall  = clientCall;
     _path        = path;
     _func        = func;
     RegisterWatch();
 }
 public ChildrenMonitorWatcher(ConsulClient client, IClientWatchManager manager, string path,
                               Action <string[], string[]> action, Func <string[], string[]> func)
 {
     this._action = action;
     _manager     = manager;
     _client      = client;
     _path        = path;
     _func        = func;
     RegisterWatch();
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeMonitorWatcher" /> class.
 /// </summary>
 /// <param name="clientCall">The client call.</param>
 /// <param name="manager">The manager.</param>
 /// <param name="path">The path.</param>
 /// <param name="action">The action.</param>
 /// <param name="allowChange">The allow change.</param>
 public NodeMonitorWatcher(Func <ValueTask <ConsulClient> > clientCall, IClientWatchManager manager, string path,
                           Action <byte[], byte[]> action, Func <string, bool> allowChange)
 {
     _action      = action;
     _manager     = manager;
     _clientCall  = clientCall;
     _path        = path;
     _allowChange = allowChange;
     RegisterWatch();
 }
 public ConsulServiceCacheManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                  ISerializer <string> stringSerializer, IClientWatchManager manager, IServiceCacheFactory serviceCacheFactory,
                                  ILogger <ConsulServiceCacheManager> logger, IConsulClientProvider consulClientFactory) : base(stringSerializer)
 {
     _configInfo          = configInfo;
     _serializer          = serializer;
     _stringSerializer    = stringSerializer;
     _serviceCacheFactory = serviceCacheFactory;
     _consulClientFactory = consulClientFactory;
     _logger  = logger;
     _manager = manager;
     EnterCaches().Wait();
 }
Exemple #8
0
 public ConsulServiceRouteManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                  ISerializer <string> stringSerializer, IClientWatchManager manager, IServiceRouteFactory serviceRouteFactory,
                                  IServiceHeartbeatManager serviceHeartbeatManager, IConsulClientProvider consulClientProvider) : base(stringSerializer)
 {
     _configInfo           = configInfo;
     _serializer           = serializer;
     _stringSerializer     = stringSerializer;
     _serviceRouteFactory  = serviceRouteFactory;
     _consulClientProvider = consulClientProvider;
     _manager = manager;
     _serviceHeartbeatManager = serviceHeartbeatManager;
     EnterRoutes().Wait();
 }
 public ConsulServiceCommandManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                    ISerializer <string> stringSerializer, IClientWatchManager manager, IServiceEntryManager serviceEntryManager,
                                    ILogger <ConsulServiceCommandManager> logger) : base(stringSerializer, serviceEntryManager)
 {
     _configInfo       = configInfo;
     _serializer       = serializer;
     _logger           = logger;
     _stringSerializer = stringSerializer;
     _manager          = manager;
     _consul           = new ConsulClient(config =>
     {
         config.Address = new Uri($"http://{configInfo.Host}:{configInfo.Port}");
     });
     EnterServiceCommands().Wait();
 }
Exemple #10
0
 public ConsulMqttServiceRouteManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                      ISerializer <string> stringSerializer, IClientWatchManager manager, IMqttServiceFactory mqttServiceFactory,
                                      ILogger <ConsulMqttServiceRouteManager> logger, IServiceHeartbeatManager serviceHeartbeatManager,
                                      IConsulClientProvider consulClientFactory) : base(stringSerializer)
 {
     _configInfo              = configInfo;
     _serializer              = serializer;
     _stringSerializer        = stringSerializer;
     _mqttServiceFactory      = mqttServiceFactory;
     _logger                  = logger;
     _manager                 = manager;
     _serviceHeartbeatManager = serviceHeartbeatManager;
     _consulClientFactory     = consulClientFactory;
     EnterRoutes().Wait();
 }
 public ConsulServiceCacheManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                  ISerializer <string> stringSerializer, IClientWatchManager manager, IServiceCacheFactory serviceCacheFactory,
                                  ILogger <ConsulServiceCacheManager> logger) : base(stringSerializer)
 {
     _configInfo          = configInfo;
     _serializer          = serializer;
     _stringSerializer    = stringSerializer;
     _serviceCacheFactory = serviceCacheFactory;
     _logger  = logger;
     _manager = manager;
     _consul  = new ConsulClient(config =>
     {
         config.Address = new Uri($"http://{configInfo.Host}:{configInfo.Port}");
     }, null, h => { h.UseProxy = false; h.Proxy = null; });
     EnterCaches().Wait();
 }
Exemple #12
0
 public ConsulServiceCommandManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                    ISerializer <string> stringSerializer, IServiceRouteManager serviceRouteManager, IClientWatchManager manager, IServiceEntryManager serviceEntryManager,
                                    ILogger <ConsulServiceCommandManager> logger,
                                    IServiceHeartbeatManager serviceHeartbeatManager, IConsulClientProvider consulClientFactory) : base(stringSerializer, serviceEntryManager)
 {
     _configInfo              = configInfo;
     _serializer              = serializer;
     _logger                  = logger;
     _consulClientFactory     = consulClientFactory;
     _stringSerializer        = stringSerializer;
     _manager                 = manager;
     _serviceRouteManager     = serviceRouteManager;
     _serviceHeartbeatManager = serviceHeartbeatManager;
     EnterServiceCommands().Wait();
     _serviceRouteManager.Removed += ServiceRouteManager_Removed;
 }
 public ConsulServiceCommandManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                    ISerializer <string> stringSerializer, IServiceRouteManager serviceRouteManager, IClientWatchManager manager, IServiceEntryManager serviceEntryManager,
                                    ILogger <ConsulServiceCommandManager> logger) : base(stringSerializer, serviceEntryManager)
 {
     _configInfo          = configInfo;
     _serializer          = serializer;
     _logger              = logger;
     _stringSerializer    = stringSerializer;
     _manager             = manager;
     _serviceRouteManager = serviceRouteManager;
     _consul              = new ConsulClient(config =>
     {
         config.Address = new Uri($"http://{configInfo.Host}:{configInfo.Port}");
     }, null, h => { h.UseProxy = false; h.Proxy = null; });
     EnterServiceCommands().Wait();
     _serviceRouteManager.Removed += ServiceRouteManager_Removed;
 }
 public ConsulServiceSubscribeManager(ConfigInfo configInfo, ISerializer <byte[]> serializer,
                                      ISerializer <string> stringSerializer, IClientWatchManager manager, IServiceSubscriberFactory serviceSubscriberFactory,
                                      ILogger <ConsulServiceSubscribeManager> logger) : base(stringSerializer)
 {
     _configInfo               = configInfo;
     _serializer               = serializer;
     _stringSerializer         = stringSerializer;
     _serviceSubscriberFactory = serviceSubscriberFactory;
     _logger  = logger;
     _manager = manager;
     _logger.LogInformation($"ConsulServiceSubscribeManager->ConsulClient Connect to http://{configInfo.Host}:{configInfo.Port}"); //20180719
     _consul = new ConsulClient(config =>
     {
         config.Address = new Uri($"http://{configInfo.Host}:{configInfo.Port}");
     }, null, h => { h.UseProxy = false; h.Proxy = null; });
     EnterSubscribers().Wait();
 }
 public ConsulServiceRouteManager(
     ISerializer <string> serializer
     , ISerializer <byte[]> byteSerializer
     , ISerializer <string> stringSerializer
     , IOptions <ConfigInfo> configInfo
     , IOptions <ServerAddress> address
     , IClientWatchManager manager
     , IServiceRouteFactory serviceRouteFactory
     , ILogger <ConsulServiceRouteManager> logger) : base(serializer)
 {
     _config           = configInfo.Value;
     _address          = address.Value;
     _manager          = manager;
     _byteSerializer   = byteSerializer;
     _stringSerializer = stringSerializer;
     _consul           = new ConsulClient(config =>
     {
         config.Address = new Uri($"http://{_config.Host}:{_config.Port}");
     });
     _serviceRouteFactory = serviceRouteFactory;
     _logger = logger;
     EnterRoutes().Wait();
 }
Exemple #16
0
 public ChildWatchRegistration(IClientWatchManager watchManager, Watcher watcher, string clientPath)
     : base(watcher, clientPath)
 {
     this.watchManager = watchManager;
 }