@magic-xpa/utils 4.1300.0-dev4130.129 → 4.1300.0-dev4130.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5779,9 +5779,10 @@ class SubscriberClient {
|
|
|
5779
5779
|
subscribedTopics = new Set();
|
|
5780
5780
|
messageSubject = new Subject();
|
|
5781
5781
|
subscriptionsDataSubject = new Subject();
|
|
5782
|
-
constructor() {
|
|
5782
|
+
constructor(serverURI) {
|
|
5783
5783
|
// Connect to the Socket.IO server with subscriber role
|
|
5784
|
-
|
|
5784
|
+
const serverUrl = serverURI; //Environment.Instance.GetPubSubServerURI();
|
|
5785
|
+
this.socket = io(serverUrl, {
|
|
5785
5786
|
query: {
|
|
5786
5787
|
role: 'subscriber',
|
|
5787
5788
|
token: 'abc123' // Default token for testing; replace with actual authentication
|
|
@@ -5813,6 +5814,7 @@ class SubscriberClient {
|
|
|
5813
5814
|
// Handle incoming messages
|
|
5814
5815
|
this.socket.on('message', (data) => {
|
|
5815
5816
|
this.messageSubject.next(data);
|
|
5817
|
+
console.warn("message", data);
|
|
5816
5818
|
});
|
|
5817
5819
|
// Handle subscriptions data
|
|
5818
5820
|
this.socket.on('subscriptionsData', (data) => {
|
|
@@ -5822,9 +5824,9 @@ class SubscriberClient {
|
|
|
5822
5824
|
/**
|
|
5823
5825
|
* Get the singleton instance of SubscriberClient
|
|
5824
5826
|
*/
|
|
5825
|
-
static getInstance() {
|
|
5827
|
+
static getInstance(serverURI) {
|
|
5826
5828
|
if (!SubscriberClient.instance) {
|
|
5827
|
-
SubscriberClient.instance = new SubscriberClient();
|
|
5829
|
+
SubscriberClient.instance = new SubscriberClient(serverURI);
|
|
5828
5830
|
}
|
|
5829
5831
|
return SubscriberClient.instance;
|
|
5830
5832
|
}
|