public ZKConfigurationProvider(ZKConfigurationOption option, AlwaysOnZooKeeperClient client, IDataSerializer serializeProvider = null, Encoding encoding = null) { this._option = option; this._client = client; this._serializer = serializeProvider; this._encoding = encoding ?? Encoding.UTF8; this._node_watcher = new CallBackWatcher(this.NodeWatchCallback); }
public static IConfigurationBuilder AddZookeeper( this IConfigurationBuilder builder, AlwaysOnZooKeeperClient client, CancellationToken cancellationToken, Func <ZKConfigurationOption, ZKConfigurationOption> config = null) { var option = new ZKConfigurationOption(); if (config != null) { option = config.Invoke(option); } var zkConfigSource = new ZKConfigurationSource(option, client, cancellationToken); return(builder.Add(zkConfigSource)); }
public ZKConfigurationSource(ZKConfigurationOption option, AlwaysOnZooKeeperClient client, CancellationToken cancellationToken) { this._provider = new ZKConfigurationProvider(option, client); }