-
April 13th, 2022, 05:03 PM
#1
I assume that
const client = Lightstreamer.LightstreamerClient(lsServer, adapterSet)
stands for
const client = new Lightstreamer.LightstreamerClient(lsServer, adapterSet)
Also from your citation I assume that you are not interested in Lightstreamer connection sharing feature and you opt for the sharing of the pointer to the LightstreamerClient object.
So, the code of the child module should be similar to the code of the parent, but for the first line:
instead of
const client = new Lightstreamer.LightstreamerClient(lsServer, adapterSet)
it should need something like
const client = myParent.client
where by myParent.client I denote the client object that was created by the parent module.
That said, I cannot specify how this pointer should be determined exactly, as it depends only on your code.
However, your pseudocode hides an important point: the Subscription object should be provided with a listener, through addListener.
The listener is needed to have the code consume in some way the data flow associated with the subscription.
So, both the parent and the child modules will specify a local listener object and this is how each module receives the data it subscribed to.
-
April 14th, 2022, 08:31 PM
#2
I can't even run a simple instace. I get an error "cannot find name 'Lightstreamer' at:
I am using version ^7.3.2 in package.json.
I see some odd references to adding lighstreamer.min.js to assets folder in your demo example. Isn't this a normal npm install?
Yes, omited a 'new' and I *do* have a listener that I neglected to post. So correction:
- const client = new Lightstreamer.LightstreamerClient(lsServer, adapterSet)
- ....client.xxx0 = yyy, etc
- ....client.xxx1 = yyy, etc
- ...client.addListener(...)
- const item = 'json::: + 'parentTopic' + '::::${some string} + user + '\')
- const subscription = new Lighstreamer.Subscription('RAW', [item], '['Body']);
- .client.subscribe(subscription)
-
April 16th, 2022, 01:25 AM
#3
I finally have it working. Note, we are behind a corporate firewall and can’t access external repos. What I have gathered from the docs link you shared though is the simple npm install isn’t a thing and some minified file has to be installed in an assets folder which is unusual. In fact, that was the exact problem I was facing and I had to copy over the client min file from another internal app’s node modules. That’s not normal at all and has little to do with advanced notions of modularity. Simple npm installations are not new and at least a decade old. All your examples as such are problematic if they don’t adhere to this very basic notion.
Anyway, it’s still not clear what the correspondence between client, subscription, and topic is or what is recommended and why? Is it correct you can have multiple subscriptions to a client? What about topics? One topic per subscription or multiple or why? It would be great if the documents show a modern simple client subscriptions topic example with a standard npm install instead of rather old html script js references (I don’t see a simple angular 2 (13.x now) example step through clearly.
Given your responses above, my next questions will be on performance. Everything is frontend angular btw. Many thanks.
Last edited by Megabyzus; April 16th, 2022 at 01:49 AM.
Similar Threads
-
By mhasan in forum Client SDKs
Replies: 27
Last Post: October 21st, 2020, 10:30 AM
-
By mhasan in forum General
Replies: 6
Last Post: July 11th, 2016, 09:27 AM
-
By stephenallred in forum General
Replies: 3
Last Post: August 16th, 2011, 10:39 AM
-
By atamel in forum General
Replies: 3
Last Post: August 9th, 2010, 02:09 PM
-
By kirthin in forum General
Replies: 1
Last Post: November 18th, 2009, 09:44 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 12:58 AM.
Bookmarks