WeaveSvc_processCommands: async + async/yield -> sync.

This commit is contained in:
Edward Lee 2009-06-05 22:21:25 -07:00
parent a6ac402f34
commit 16a159e5d9

View File

@ -863,7 +863,7 @@ WeaveSvc.prototype = {
// Process the incoming commands if we have any
if (Clients.getClients()[Clients.clientID].commands) {
try {
if (!(yield this.processCommands(self.cb))) {
if (!(this.processCommands())) {
this._detailedStatus.setSyncStatus(ABORT_SYNC_COMMAND);
throw "aborting sync, process commands said so";
}
@ -1138,13 +1138,10 @@ WeaveSvc.prototype = {
/**
* Check if the local client has any remote commands and perform them.
*
* @param onComplete
* Callback when this method completes
* @return False to abort sync
*/
processCommands: function WeaveSvc_processCommands(onComplete) {
let fn = function WeaveSvc__processCommands() {
let self = yield;
processCommands: function WeaveSvc_processCommands()
this._notify("process-commands", "", function() {
let info = Clients.getInfo(Clients.clientID);
let commands = info.commands;
@ -1178,10 +1175,8 @@ WeaveSvc.prototype = {
}
}
self.done(true);
};
this._notifyAsync("process-commands", "", fn).async(this, onComplete);
},
return true;
})(),
/**
* Prepare to send a command to each remote client. Calling this doesn't