Results 1 to 10 of 21

Hybrid View

  1. #1
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    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.

  2. #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:


    1. const client = new Lightstreamer.LightstreamerClient(lsServer, adapterSet)
    2. ....client.xxx0 = yyy, etc
    3. ....client.xxx1 = yyy, etc
    4. ...client.addListener(...)
    5. const item = 'json::: + 'parentTopic' + '::::${some string} + user + '\')
    6. const subscription = new Lighstreamer.Subscription('RAW', [item], '['Body']);
    7. .client.subscribe(subscription)

  3. #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

  1. Replies: 27
    Last Post: October 21st, 2020, 10:30 AM
  2. Replies: 6
    Last Post: July 11th, 2016, 09:27 AM
  3. Replies: 3
    Last Post: August 16th, 2011, 10:39 AM
  4. J2EE app to push message via LS w/o JMS
    By atamel in forum General
    Replies: 3
    Last Post: August 9th, 2010, 02:09 PM
  5. Replies: 1
    Last Post: November 18th, 2009, 09:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:58 AM.