A client is connected to a nodejs hosted cube evaluator using websockets.
When the limit is set to anything over 900 the server blows up with the following error:
// Copyright Joyent, Inc. and other Node contributors.
^
RangeError: Maximum call stack size exceeded
The code was copied straight from the websites getting started guide I.e.
var socket = new WebSocket("ws://nodeserver/1.0/event/get");
socket.onopen = startReceiving;
function startReceiving() {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
var startDate = yesterday.getTime();
socket.send(JSON.stringify({
"expression": "some_event(param1,param2,param3,param4).eq(param1,'SomeValue')",
"start": startDate,
limit: 20000
}));
socket.send(JSON.stringify({
"expression": "someother_event(param1,param2,param3,param4).eq(param1,'SomeOtherValue')",
"start": startDate,
limit: 20000
}));
}
socket.onmessage = function (message) {
var event = JSON.parse(message.data);
// Do something with event
};
var cube = require("cube");
var appConfig = require('./server.config.js');
var evaluatorOptions = appConfig.evaluatorOptions;
var registerServer = function(options, cubeSubject) {
var server = cube.server(options);
server.register = function(db, endpoints) {
cubeSubject.register(db, endpoints);
};
server.start();
};
registerServer(evaluatorOptions, cube.evaluator);
Can anyone suggests what I'm doing wrong here?
Getting the latest version of the cube library solved the above issue.