code: function(client, window, timeoutSeconds, action, args) {
        this._window = window;
        if (!timeoutSeconds)
          timeoutSeconds = 30;
  
        var doTimeout = function (action, client, args) {
          return function () {
            return action.apply(client, args);
          };
        };
        this.timeout = setTimeout(doTimeout(action, client, args), timeoutSeconds * 1000);
  
        this.cancel = function() {
          this._window.clearTimeout(this.timeout);
        };
      }
docs: Monitor request completion.
  @ignore