本文整理汇总了C#中Cluster.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Cluster.Dispose方法的具体用法?C# Cluster.Dispose怎么用?C# Cluster.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cluster
的用法示例。
在下文中一共展示了Cluster.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: When_Disposing_StreamingProvider_Worker_Thread_Does_Not_Hang_No_Buckets_Open
public void When_Disposing_StreamingProvider_Worker_Thread_Does_Not_Hang_No_Buckets_Open()
{
//remove CCCP provider because we want to bootstrap off of the StreamingProvider
var cccp = _clusterManager.ConfigProviders.Find(x => x is CarrierPublicationProvider);
_clusterManager.ConfigProviders.Remove(cccp);
var cluster = new Cluster(_clientConfig, _clusterManager);
cluster.Dispose();
}
示例2: When_HttpConfigProvider_Used_ClusterInfo_Accessible
public void When_HttpConfigProvider_Used_ClusterInfo_Accessible()
{
var clusterManager = new ClusterController(_clientConfig);
//force use of StreamingHttpProvider by removing other providers
clusterManager.ConfigProviders.Remove(
clusterManager.ConfigProviders.Find(provider => !(provider is HttpStreamingProvider)));
var cluster = new Cluster(_clientConfig, clusterManager);
var bucket = cluster.OpenBucket("default", "");
var info = cluster.Info;
cluster.CloseBucket(bucket);
cluster.Dispose();
Assert.NotNull(info);
Assert.NotNull(info.Pools());
Assert.NotNull(info.BucketConfigs());
Assert.Greater(info.BucketConfigs().Count, 0);
Assert.NotNull(info.BucketConfigs().ElementAt(0));
}