B
Brian Takita
Hello, we are implementing a function that uses recursion to poll a
server. This implementation seems like it would cause a memory ramp up
and possibly a stack overflow. Am I correct? Is there anyway to
accomplish polling without this issue?
function poll() {
$.get('/message_queue/' + gaming_session.guid,
function(command_string) {
var messages = JSON.parse(command_string);
for (var i = 0; i < messages.length; i++) {
Model.execute_server_commands(messages);
}
poll();
});
}
poll();
server. This implementation seems like it would cause a memory ramp up
and possibly a stack overflow. Am I correct? Is there anyway to
accomplish polling without this issue?
function poll() {
$.get('/message_queue/' + gaming_session.guid,
function(command_string) {
var messages = JSON.parse(command_string);
for (var i = 0; i < messages.length; i++) {
Model.execute_server_commands(messages);
}
poll();
});
}
poll();