Skip to content

Instantly share code, notes, and snippets.

@a-ignatov-parc
Created February 9, 2012 06:22
Show Gist options
  • Save a-ignatov-parc/1777812 to your computer and use it in GitHub Desktop.
Save a-ignatov-parc/1777812 to your computer and use it in GitHub Desktop.
heartbeatTimout: 4,
heartbeatState: YES,
// Обработчик heartbeat срабатывает когда по таймеру приходит время выполнить запрос
startHeartbeat: function() {
var policy = Calc.get('Policy').model;
Calc.requestWraper(policy, 'send', {
account: policy.get('AccountNumber')
}, {
action: 'do_heartbeat'
});
},
stopHeartbeat: function() {
Calc._heartbeatTimer && clearTimeout(Calc._heartbeatTimer);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment