コード例 #1
0
        public async Task OneTimeTearDown()
        {
            // remove temp files
            foreach (var fileInfo in new DirectoryInfo(Path.GetTempPath()).GetFiles())
            {
                try { fileInfo.Delete(); }
                catch (Exception) { /* ignore */ }
            }

            // terminate & remove member (just in case)
            if (RcMember != null)
            {
                await RcClient.StopMemberAsync(RcCluster, RcMember);

                RcMember = null;
            }

            // terminate & remove client (needed) and cluster (just in case)
            if (RcClient != null)
            {
                if (RcCluster != null)
                {
                    await RcClient.ShutdownClusterAsync(RcCluster).CfAwait();

                    RcCluster = null;
                }
                await RcClient.ExitAsync().CfAwait();

                RcClient = null;
            }
        }
コード例 #2
0
 public async Task ClusterOneTimeTearDown()
 {
     // terminate & remove client and cluster
     if (RcClient != null)
     {
         if (RcCluster != null)
         {
             await RcClient.ShutdownClusterAsync(RcCluster).CfAwait();
         }
         await RcClient.ExitAsync().CfAwait();
     }
 }