7.3.2 • Published 6 years ago

lightstreamer-client v7.3.2

Weekly downloads
389
License
-
Repository
-
Last release
6 years ago

Lightstreamer Client

:warning: This library is deprecated!

Use the new Lightstreamer Client Node.js SDK or Lightstreamer Client Web SDK instead.

Use

Install the package using npm

npm install lightstreamer-client

Create a client and connect

var ls = require("lightstreamer-client");
var lsClient = new ls.LightstreamerClient("http://push.lightstreamer.com","DEMO");  
lsClient.connect();

Create a Subscription and send it to the server

var testSubscription = new ls.Subscription("MERGE",["item1","item2","item3"],["stock_name","last_price"]);
testSubscription.setDataAdapter("QUOTE_ADAPTER");
testSubscription.setRequestedSnapshot("yes");
lsClient.subscribe(testSubscription);

Listen for events

lsClient.addListener({
	onStatusChange: function(newStatus) {         
	  console.log(newStatus);
	}
});

testSubscription.addListener({
	onSubscription: function() {
	  console.log("SUBSCRIBED");
	},
	onUnsubscription: function() {
	  console.log("UNSUBSCRIBED");
	},
	onItemUpdate: function(obj) {
	  console.log(obj.getValue("stock_name") + ": " + obj.getValue("last_price"));
	}
});

For further details check the API and the available examples

7.3.2

6 years ago

7.3.1

7 years ago

7.3.0

7 years ago

7.2.4

7 years ago

7.2.3

8 years ago

7.2.2

8 years ago

7.2.1

8 years ago

7.2.0

8 years ago

7.1.1

8 years ago

7.1.0

9 years ago

7.0.9

9 years ago

7.0.8

9 years ago

7.0.7

9 years ago

7.0.6

9 years ago

7.0.5

9 years ago

7.0.4

9 years ago

7.0.3

10 years ago

6.2.7

10 years ago

7.0.0

10 years ago

6.1.4

10 years ago

6.2.6

10 years ago

6.2.5

11 years ago

6.2.4

11 years ago

6.2.3

11 years ago