7.3.2 • Published 4 years ago
lightstreamer-client v7.3.2
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
4 years ago
7.3.1
5 years ago
7.3.0
5 years ago
7.2.4
6 years ago
7.2.3
6 years ago
7.2.2
6 years ago
7.2.1
6 years ago
7.2.0
6 years ago
7.1.1
6 years ago
7.1.0
7 years ago
7.0.9
7 years ago
7.0.8
7 years ago
7.0.7
7 years ago
7.0.6
7 years ago
7.0.5
7 years ago
7.0.4
7 years ago
7.0.3
8 years ago
6.2.7
8 years ago
7.0.0
8 years ago
6.1.4
9 years ago
6.2.6
9 years ago
6.2.5
9 years ago
6.2.4
9 years ago
6.2.3
9 years ago