-
May 18th, 2016, 09:16 AM
#3
Hey,
So this is what I've done, where "qqq" is the id of my label which is extracting item1 from the static grid - stocksGrid. I just have 1 item in my grid where messages keep updating.
<!-- JavaScript code specific of this application -->
<script type="text/javascript">
var count =0;
require(["js/lsClient","Subscription","StaticGrid"],
function(lsClient,Subscription,StaticGrid) {
var stocksGrid = new StaticGrid("stocks",true);
stocksGrid.setAutoCleanBehavior(true,false);
stocksGrid.addListener({
onVisualUpdate: function(key,info) {
var d = new Date();
count++;
var starttime = 0;
var endtime = 0;
if(count==1)
{
starttime = d.getMilliseconds();
}
else
{
endtime = d.getMilliseconds();
}
if (info != null) {
var arrayofitems = ['ClientMsgCount:',count++,'Time:',endtime-starttime,'Message :',info.So.topicdata];
document.getElementById("qqq").innerHTML =arrayofitems ;
}
var cold = (key.substring(4) % 2 == 1) ? "#eeeeee" : "#ddddee";
info.setAttribute("yellow", cold, "backgroundColor");
}
});
var stockSubscription = new Subscription("MERGE",stocksGrid.extractItemList(), stocksGrid.extractFieldList());
stockSubscription.addListener(stocksGrid);
stockSubscription.setDataAdapter("QUOTE_ADAPTER");
stockSubscription.setRequestedSnapshot("yes");
lsClient.subscribe(stockSubscription);
});
</script>
So, I have set a counter in my java data adapter which reads 29995 messages from a file which it does in 1.6 seconds. But when I send it to the javascript client and set a counter like I have in the script code above, the 2 counters show different number of messages.
My label on my clientpage looks like this:
ClientMsgCount:76, Time:778, Message: AdapterMsgCount:29995,IBM UN EQUITY,3/30/2016 11:48:49 AM,Active,Invalid Security,LAST_PRICE=86.000,BID=86.000,ASK=86.100
Is my javascript client not able to consume all 29995 messages sent by the data adapter? If so, why? I don't understand why both my message counts are different?
Thanks
Do help me out
Priyanka
Last edited by Priyanka; May 27th, 2016 at 11:31 AM.
Similar Threads
-
By Daniel Mihalko in forum Adapter SDKs
Replies: 1
Last Post: July 11th, 2013, 09:51 AM
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:05 PM.
Bookmarks