You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2023/02/23 15:15:00 UTC
[rocketmq-clients] 20/28: Polish code
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit 2f734d6327cca4e6cf323b732f464a458a2b2ee5
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Mon Feb 20 19:14:15 2023 +0800
Polish code
---
csharp/rocketmq-client-csharp/Client.cs | 12 +++---------
csharp/rocketmq-client-csharp/IClient.cs | 2 --
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/csharp/rocketmq-client-csharp/Client.cs b/csharp/rocketmq-client-csharp/Client.cs
index 5a2cd69f..24e1e4ac 100644
--- a/csharp/rocketmq-client-csharp/Client.cs
+++ b/csharp/rocketmq-client-csharp/Client.cs
@@ -54,7 +54,6 @@ namespace Org.Apache.Rocketmq
protected readonly ConcurrentDictionary<Endpoints, bool> Isolated;
private readonly ConcurrentDictionary<string, TopicRouteData> _topicRouteCache;
- private readonly CancellationTokenSource _telemetryCts;
private readonly Dictionary<Endpoints, Session> _sessionsTable;
private readonly ReaderWriterLockSlim _sessionLock;
@@ -72,7 +71,6 @@ namespace Org.Apache.Rocketmq
_topicRouteUpdateCts = new CancellationTokenSource();
_settingsSyncCts = new CancellationTokenSource();
_heartbeatCts = new CancellationTokenSource();
- _telemetryCts = new CancellationTokenSource();
_statsCts = new CancellationTokenSource();
_sessionsTable = new Dictionary<Endpoints, Session>();
@@ -99,9 +97,10 @@ namespace Org.Apache.Rocketmq
public virtual async Task Shutdown()
{
Logger.Debug($"Begin to shutdown rocketmq client, clientId={ClientId}");
- _topicRouteUpdateCts.Cancel();
_heartbeatCts.Cancel();
- _telemetryCts.Cancel();
+ _topicRouteUpdateCts.Cancel();
+ _settingsSyncCts.Cancel();
+ _statsCts.Cancel();
NotifyClientTermination();
await ClientManager.Shutdown();
Logger.Debug($"Shutdown the rocketmq client successfully, clientId={ClientId}");
@@ -411,11 +410,6 @@ namespace Org.Apache.Rocketmq
}
}
- public CancellationTokenSource TelemetryCts()
- {
- return _telemetryCts;
- }
-
public abstract Settings GetSettings();
public string GetClientId()
diff --git a/csharp/rocketmq-client-csharp/IClient.cs b/csharp/rocketmq-client-csharp/IClient.cs
index fc4c0127..3d20d3d5 100644
--- a/csharp/rocketmq-client-csharp/IClient.cs
+++ b/csharp/rocketmq-client-csharp/IClient.cs
@@ -23,8 +23,6 @@ namespace Org.Apache.Rocketmq
{
public interface IClient
{
- CancellationTokenSource TelemetryCts();
-
ClientConfig GetClientConfig();
Settings GetSettings();