Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #529 from adobe/integrate-509
Browse files Browse the repository at this point in the history
Integrate PR #509
  • Loading branch information
abose committed Jul 20, 2015
2 parents 56330f8 + 166aef3 commit fe6adb1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion appshell/node-core/ConnectionManager.js
Expand Up @@ -170,7 +170,17 @@ maxerr: 50, node: true */
this._send("commandResponse", {id: id, response: response });
}
};


/**
* Sends a progress message to command execution (async commands only)
* @param {number} id unique ID of the command that was executed. ID is
* generated by the client when the command is issued.
* @param {string} message Progress message
*/
Connection.prototype.sendCommandProgress = function (id, message) {
this._send("commandProgress", {id: id, message: message});
};

/**
* Sends a response indicating that an error occurred during command
* execution
Expand Down
6 changes: 5 additions & 1 deletion appshell/node-core/DomainManager.js
Expand Up @@ -148,7 +148,8 @@ maxerr: 50, node: true */
* @param {string} domainName The domain name.
* @param {string} commandName The command name.
* @param {Array} parameters The parameters to pass to the command function. If
* the command is asynchronous, will be augmented with a callback function.
* the command is asynchronous, will be augmented with a callback function
* and progressCallback function
* (see description in registerCommand documentation)
*/
function executeCommand(connection, id, domainName,
Expand All @@ -164,6 +165,9 @@ maxerr: 50, node: true */
connection.sendCommandResponse(id, result);
}
};
var progressCallback = function (msg) {
connection.sendCommandProgress(id, msg);
};
parameters.push(callback);
command.commandFunction.apply(connection, parameters);
} else { // synchronous command
Expand Down

0 comments on commit fe6adb1

Please sign in to comment.