cleanup: Modernize PubSubRoute code, json parsing

This commit is contained in:
John Colvin committed 2024-09-19 20:02:09 +00:00
1 parent 0ee450b12a
commit 6e89f42bc8
1 file changed
+6 -6
@@ -48,6 +48,7 @@ namespace BCG {
throw new ArgumentException($"Failed to find route for tag '{tag}'", nameof(tag));
}
Log.Gen.info($"PubSubRouter.get_sub_url_for_tag tag: {tag} route: {route}");
ArgumentNullException.ThrowIfNull(route.ServerAddress);
return RemoteConnectionInfo.parse_url(route.ServerAddress);
}
@@ -56,17 +57,18 @@ namespace BCG {
throw new ArgumentException($"Failed to find route for tag '{tag}'", nameof(tag));
}
Log.Gen.info($"PubSubRouter.get_sub_url_for_tag tag: {tag} route: {route}");
ArgumentNullException.ThrowIfNull(route.ServerAddress);
return RemoteConnectionInfo.parse_url(route.ServerAddress);
}
public List<string> get_all_pubsub_sub_urls() =>
_sub_routes.Select(r => r.ServerAddress).ToList();
_sub_routes.Select(r => r.ServerAddress ?? throw new InvalidOperationException("Route.ServerAddress is null")).ToList();
public List<string> get_all_pubsub_pub_urlss() =>
_pub_routes.Select(r => r.ServerAddress).ToList();
_pub_routes.Select(r => r.ServerAddress ?? throw new InvalidOperationException("Route.ServerAddress is null")).ToList();
public event PubSubTagURLChangeDelegate onSubURLTagRouteChange;
public event PubSubTagURLChangeDelegate onPubURLTagRouteChange;
public event PubSubTagURLChangeDelegate? onSubURLTagRouteChange;
public event PubSubTagURLChangeDelegate? onPubURLTagRouteChange;
#endregion
@@ -77,7 +79,5 @@ namespace BCG {
aVar = aVar + 2;
}
}
}
}